views:

375

answers:

5

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.

  1. Is it efficient and easy when you use n-tier architecture in ASP.NET MVC?
  2. Should I create my own entities in Business Logic Layer or use SQL Tables as entities?
  3. 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?

+1  A: 

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.

Jeff Widmer
NerdDinner is a very small website and isn't using n-tier architecture
Marc V
+1  A: 

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

Robert Harvey
Well i have already built an application (larger than NerdDinner) in asp.net MVC without using n-tier architecture. I have also built applications which uses n-tier architecture (which are not built in MVC). I know how asp.net works and also learnt a lot how asp.net mvc works. but when using LINQ and MVC together with n-tier, I want to know what's the best way to do it. I also want to know which question was premature, on you are ashamed to answer. StackOverFlow is built in ASP.NET MVC and LINQ, thats why I asked this question here.
Marc V
+4  A: 

My 2 cents:

  1. 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.
  2. 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.
  3. 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.

Shiraz Bhaiji
A: 

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.

craigmoliver
+1  A: 

Hey buddy!

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

danfromisrael