Asp.net MVC Question regarding n-tier - asp.net

I have studied a lot of starter kits for ASP.NET and ASP.NET MVC really is awesome compared to web forms, because it runs fast and developement is easy. But when I fit ASP.NET MVC, LINQ in a site with a lot of visitors and mostly controls based website, I got so many issues in my mind.
Let's say I want to build a website which is small scale, but got a lot of visitors and mostly controls based (i.e. TV Show Information website). You've got shows, episodes.
Is it efficient and easy when you use n-tier architecture in ASP.NET MVC?
Should I create my own entities in Business Logic Layer or use SQL Tables as entities?
Should I use Application Cache in it to save all shows in cache?
I like the Presentation Layer of MVC using LINQ but when it comes to DataAccess and BusinessLogic its confusing me. Can anyone help?

My 2 cents:
In my opinion there is no difference between using ASP.Net MVC or Web Forms in an N-Tier architecture. We use WCF to comunicate between tiers.
We create Data Transfer Objects that are not the Entity Framework Entities. However, I expect this to change with the next version of Entity Framework which introduces POCO.
Not sure what you mean by "shows". ASP.Net has its own caching for pages, for caching data you could use Enterprise Library.
Just to clarify I define a Tier as a separate machine, where as a layer would be a separate dll.

i've just read an amazing article regarding working n-tier with asp.net mvc
check it out:
http://www.codeproject.com/KB/aspnet/ASP_NET_MVC_WITH_EF.aspx
it's all about right architecture working with ASP.NET MVC Framework + N-tier + Entity Framework
enjoy!
:-Dan

I highly recommend the NerdDinner ASP.NET MVC Tutorial. You can get more info on it and download the free chapter from ScottGu's blog post here.
In the code that accompanies that sample chapter there is a pretty good architecture structure that you can use to base your architecture on. I have gone back to it several times when trying to see how to architect something in ASP.NET MVC.

Have you built your first application in ASP.NET MVC yet, or are you still studying?
I think you should start with an architecture similar to NerdDinner and refactor after you become more familiar with how ASP.NET MVC works.
If you really are well versed in multi-tier, then you should be able to figure it out without help from us. Try some things. Do what works. Try not to worry so much about being "correct."
Some of what you are asking in your question is premature if you haven't written your first ASP.NET MVC application yet.
By the way, I found Scott Hanselman's "File/New/NerdDinner" video both enlightening and entertaining: http://videos.visitmix.com/MIX09/T49F

I use my own flavor of n-Tier with MVC because I don't like LINQ-to-SQL and the Entity Framework. I've also written some T4 templates that generate those objects and the use the Enterprise Library to interact with the DB. It's up to you, whatever works.

Related

Can someone please explain the difference between ASP.NET MVC & .NET Core 3.1

Hello I have built an application using asp.net MVC, this project is all working well but I am finding a lot of documentation with Stripe has documentation depreciated, however, the documentation is fine for asp.net core
Is it a massive change between the two types, why doesn't it seem to work with my one. I am new to all of this but it doesn't really make a lot of sense to me so please explain in lamens terms and link some articles if it would help :)
I understand your confusion :D I've worked with ASP.NET for very long (since web forms). I'll try to explain to the best of my understanding.
MVC is a design pattern that has seen a lot of success and has been adapted widely by several frameworks. ASP.NET MVC is the dot net implementation of the MCV pattern.
ASP.NET Core is a redesign of ASP.NET with a lot of new features and benefits. The biggest advertised differences is the fact that DOT NET CORE is open source and cross platform.
In an asp.net core web application you will still see the MVC pattern with several improvements since ASP.NET MVC.
If your project works perfectly you don't have to do a complete redesign. The frameworks will keep updating and as developers we need to stay updated but we can't go and redesign every project. New projects are a different story. If you start something new definitely consider using ASP.NET Core.
Here is one of Microsoft's docs that helps understand the difference.
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/choose-aspnet-framework?view=aspnetcore-3.1
If you split your application into different projects for the front-end stuff, business logic, and data access, it shouldn't be too painful to port it over. The business and data access code should mostly work the same way. it's just the bit of MVC presentation stuff that will be markedly different.

learning web app development with asp.net

I have been doing windows applications using c#.
But recently our management has planned to make some of the projects to be web based.
We thought of using asp.net with c#.
Can anybody guide me on effectively learning asp.net.
pls provide some useful links for sample projects.
Thanks in advance.
Web Forms would be a quicker route if your used to desktop development (over microsoft MVC). MVC3 is my preference but takes a bit longer to get used to if your not familiar with it. MVC3 gives you more control over your code and in my oppinion is less bloated.
May be worth looking into the MVC pattern if you go down this route.
Loads of videos to get you started here: http://www.asp.net/web-forms
They have a couple of example applications you can work through:
Web Forms: Contoso University App
MVC: MVC3 Starter App
as simple as this: http://www.asp.net
I'd recommend to start with ASP.Net MVC even you'll find it a bit complex in the beginning , Here you can find a lot of tutorials and books
you can also take a look at the MVC Music Store , it is a complete project to learn ASP.Net MVC by example.
I would steer clear of WebForms - even though it may seem a more natural fit coming from your WinForms background, you will run into issues later on. Given that you're going to have to learn a new platform anyway, makes sense to learn MVC and get off on the right foot (note that there are alternative MVC frameworks to ASP.NET MVC such as Fubu but these are probably riskier options in your situation).
PluralSight do some good online training courses, though you do need to pay for them.

ASP.NET MVC Experiences/Success Stories [2010]

At the moment we're evaluating whether it's worth it to start using ASP.NET MVC in combination with Visual Studio 2010.
I've been searching the web for experiences developers have had with working with ASP.NET MVC. I can't seem to find any. So I decided to post a question here.
Are there any people out there that have used ASP.NET-MVC for serious development? What are the experiences so far? Does ASP.NET-MVC help or hinder projects? Do you deliver your project on time? Does ASP.NET-MVC save you time or does it make you go over time and over budget?
And then the big question: Now that you've been working with ASP.NET MVC for a while, do you wish you had chosen an alternative? If that's the case, which alternative?
Thanks,
M
StackOverflow itself is an ASP.NET MVC site and I would say it is pretty successful.
I think it depends more on the people doing the actual implementation of the site than on the technology used how 'successful' the end result will be (successful in the broadest sense: on time, within budget, happy end users, ...).
Asp.net mvc is a better then asp.net webform some reason are here
the logic code in asp.net MVC is maintainable and clean.
he provide a better performance then webform
provide a pretty url for SEO and user-friendly.
full control on mockup [without using server-side control].
if you want to see there are many example of MVC project. stackoverflow.com is one of them.
I am a big fan of ASP.NET MVC (especially with the great improvements done in MVC3). I have worked on two big sites built entirely in MVC2 SempToshiba Brazil and Cyrela Brasil. These projects have been quite sucessful. They were delivered on time, saved time and our clients were very happy. Lastly, no, I would not have chosen an alternative. A side note, the Cyrela project was actually a re-do of a ASP.NET Web Forms site that had various downsides.
On the other hand, I have seen a large project done in MVC 2 by inexperience programmers, and it is one the worse projects I have ever seen. So, over all, ASP.NET MVC has some major advantages, but if the team is inexperienced in ASP.NET MVC you will get poor results.
On another note, this post has some great ASP.NET MVC 3 material.

Asp.net MVC VS ASP.net WebForms?

I am starting a new project in VB /.Net Framework 2.0 for a company corporate website with data driven forms. So should I go further with Asp.net MVC or Asp.Net web forms and WHY ??? We are not ready for Ajax now but later.
And also we have DevExpress components.
Actually I see ASP.NET MVC as next generation in that it is an evolution - trying to be a better programming environment, as software development for web apps asks for something more testable.
It is a huge beast. Decide based on features whether you need it. MVC has less documentation and is a lot harder to master thanks to a less RAD approach, but it seems that once you are in, it will be quite a better experience. If you have a web application (like stackoverflow.com) then it may be a good approach.
DevExpress components - have fun... throwing them away. Like most ASP.NET components they will not work or only work very partially. Totally different approach.e
ASP.Net MVC is not "next generation" ASP.Net. It's an alternative approach to design that can be more beneficial depending on the kind of project you're working with. Without more information about the particular type of project you're working on no one can give you any informed recommendations.

How can I implement my own version of a MVC framework in ASP.NET?

I would like to know how I can go about implementing my own version of a MVC framework in ASP.NET? I know there already is Microsoft provided ASP.NET MVC framework, but I want to learn MVC and thought the best way would be to implement my own flavor of a MVC framework on top of ASP.NET. Any thoughts / guidance ?
Also, can anyone point me to a page where I can learn more about how microsoft implemented ASP.NET MVC ? I'm more interested in learning about the under the hood plumbing that goes on to implement the framework on top of asp.net, do they use HttpHandlers / HttpModules ?
Thanks.
You want to learn about a concept by reinventing an existing framework that already does that concept better than you will? That sounds like quite a rabbit hole to venture into.
Why not learn MVC by learning ASP.NET MVC? What's your reasoning for why that's not a valid way to learn the concepts? Learning a proven framework will be a much better approach than what you're considering.
EDIT: One other thing to consider. Knowing how to use ASP.NET MVC (or Rails, or insert-MVC-framework-here) would be a much more useful and marketable skill than the ability to roll your own MVC framework from scratch (even though that might prove more intellectually stimulating).
You can get the source for ASP.NET MVC from here: http://aspnet.codeplex.com/releases/view/41742
MVC is an architectural pattern that is not dependent on ASP.NET or any framework.
I would not advise trying to implement it on top of ASP.NET if you are just looking to learn about the Model View Controller pattern. ASP.NET will impose too many implementation details when you should instead be concentrating on the overall concept such as separation of concerns, single responsibility.
The ASP.NET MVC framework is simply an implementation of the Model View Controller pattern that runs on top of ASP.NET. Like most implementations it contains variations on the basic MVC pattern to better suit web applications and the underlying framework. So trying to re-implement ASP.NET MVC will give you a non-standard understanding of the pattern.
Martin Fowler explains the fundamental ideas of MVC in the book: Patterns of Enterprise Application Architecture.

Resources