Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linq to SQL or the Entity Framework for Enterprise ASP.NET MVC application architecture?

I am still trying to figure out the right architecture for a complex ASP.NET MVC web application.

I looked in a lot of example code and everywhere it's done differently.

I would really appreciate your thoughts on this.

Another Question: Would you use Linq to SQL or the Entity Framework?

Thanks,

-Ben

like image 674
Ben Avatar asked Jan 09 '10 14:01

Ben


1 Answers

Some personal thoughts and experiance:
- use nhibernate as orm, or wait for EF v4. Tekpub.com has good tutorial on using NH. L2S and EF are kind of black box: they are doing lot of things, they have good documentation, but they don't have extendability point. If you want to plug in some new functionality or change behavior, you can do that only with NH. EF in v4 will be in state where NH was 2 or 3 years before.
- browse as much examples of MVC apps as you can find. Lot of them you can find on codeplex. For example: CodeCampServer, WhoCanHelpMe, Storeddd
- if you're thinking of building framework (or helper) to solve some infrastructure problems, google for it first; it's high probability that someone else smarter than you (well, smarter than me in my case) already had the same problems, and wrote nice piece of code in form of framework (object mapper, validation, messaging,...), or just blogged about it.
- using sharp architecture or fubuMvc solves much of infrastructure work, but rest of app depends on you business model.
- TDD will force you to write good and maintainable code. Try using Gang of Four design patterns and SOLID principles as much as you can.

like image 109
Hrvoje Hudo Avatar answered Sep 30 '22 18:09

Hrvoje Hudo