9

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)

Mohsen Alikhani
  • 1,657
  • 3
  • 19
  • 37
RKP
  • 5,285
  • 22
  • 70
  • 111
  • "best practices" might be subjective here – Rup Oct 28 '11 at 09:24
  • by "best practices" I mean that uses application architectural and design patterns, DDD, interfaces, dependency injection, unit of work and repository patterns for EF and general object oriented design principles. in short good enough to use the ideas in an enterprise application. – RKP Oct 28 '11 at 09:32

6 Answers6

9

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

Boris Yankov
  • 1,530
  • 14
  • 21
  • thanks for the useful links. though this one doesn't answer my question (sample app) directly, these books should be very useful for me. I heard about PluralSight before, but wasn't sure if the training is worth it. I will give it a try now. – RKP Oct 31 '11 at 14:32
  • 1
    Take a look at their free MVC3 course, part of the official ASP.net MVC site from Microsoft.http://www.asp.net/mvc/pluralsight – Boris Yankov Oct 31 '11 at 14:41
  • 1
    I've invested in pluralsight.. Wicked place – Ryan Feb 20 '12 at 00:27
2

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

Mohsen Alikhani
  • 1,657
  • 3
  • 19
  • 37
1

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.

mesut
  • 2,099
  • 3
  • 23
  • 35
1

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/

Abdul Munim
  • 18,869
  • 8
  • 52
  • 61
  • I did look at this and it doesn't use DI and no abstraction layer between controller and database etc. – RKP Oct 28 '11 at 09:56
  • Yeah, I agree - it is more focused on ASP.NET MVC. I have started to work on a similar application but it is still in the design phase. The main idea is to implement a simple application how an enterprise application can be developed. Please mind that, there's no UI implemented nor any business logic implemented. Trying to get the architecture ready. You may look at the code: http://fame.codeplex.com. – Abdul Munim Oct 28 '11 at 10:06
0

Funny this kind of question comes up couple of times per week at least recently.

What I can say, only about the layering of the different projects, accordingly to my experience and feedback I've got, is to check question and my answer here:

MVC3 and Entity Framework

RKP this is not answering all and completely to your question, is about layering the architecture and some ideas on why only (see comments under my answer).

Community
  • 1
  • 1
Davide Piras
  • 43,984
  • 10
  • 98
  • 147
  • thanks for your answer, my question is more broader than just the solution structure. Please see my comment above. – RKP Oct 28 '11 at 09:37
0

I make a good pattern based on EF 4.1 and MVC3:

MVC3 and EF architecture

good luck

Arash Karami
  • 632
  • 1
  • 8
  • 19