Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sample N-tier ASP.NET MVC3 application with best practices (using EF 4.1)

I am looking for a sample ASP.NET MVC3 N-Tier application that demonstrates best practices (uses Domain Driven Design and Entity Framework 4.1 Code first). I found the following. which one do you recommend out of these (or any other one not in this list)?

http://efmvc.codeplex.com/

http://prodinner.codeplex.com/

http://www.dofactory.com/Framework/Framework.aspx (not free)

like image 970
RKP Avatar asked Oct 28 '11 09:10

RKP


4 Answers

I was in the same position not long ago.

The things you linked are OK, but certainly not enough on their own.

I find this topic lacking in the free resources, as it is quite big and needs good organization and breadth. On the other hand, there are good resources if you are willing to pay a little.

These are the resources I used:

PluralSight - training videos. ($30 per month, quite worth it, not affiliated, but a subsciber)

Here are the courses that are great on the topic:

Principles of Object Oriented Design - by Steve Smith, he is a great lector.

Design Patterns Library - over 10 hours of videos on design patterns. Can't compare them to DotFactory, but they are very well done.

Inversion of Control - what the name says, important topic in depth.

There are also lots of stuff on TDD, MVC, EF etc. All worthy topics.

Books on Kindle (I haven't been reading lots of books, but Kindle really revived my passion for written knowledge)

Professional Enterprise .NET

Microsoft® .NET: Architecting Applications for the Enterprise

Applying Domain-Driven Design and Patterns: With Examples in C# and .NET

like image 140
Boris Yankov Avatar answered Sep 30 '22 17:09

Boris Yankov


Have you seen the following projects? They also have the source code that they can have complete documentation.

http://microsoftnlayerapp.codeplex.com/

http://www.nopcommerce.com

like image 37
Mohsen Alikhani Avatar answered Sep 30 '22 19:09

Mohsen Alikhani


Best practices are always subjective. Your application may require DI and as well as Interceptors but sample apps are relatively small and putting anything into there turns out to be ridiculous. Still, I would suggest you to go through MVC Music Store. It has pretty good implementation and a very good sample.

http://mvcmusicstore.codeplex.com/

like image 25
Abdul Munim Avatar answered Sep 30 '22 17:09

Abdul Munim


Although this post is old, But I have had same problem to find a good and modern pattern for a good ntier application. After I goggling for some hour, I Found Onion Architecture By Jeffrey Palermo. It is a must read article. here: jeffreypalermo.com/blog/the-onion-architecture-part-1/

By using this article and using some other researches I Made a template (Example) of this architecture that uses Entity Framework 6.0 and Ninject Dependency Injection 3.2.0

NTierCSharpExample

I this template: Center Layer Is Domain Layer. Then Service Layer that is a bridge between presentation and Data Layer. For simplicity I used console app for presentation but you can simply remove it out and plug in a new asp.net mvc 5 application or any other presentation app you want.

like image 29
mesut Avatar answered Sep 30 '22 18:09

mesut