开发者

DDD/SoC w/Ninject Design Question?

开发者 https://www.devze.com 2023-02-15 03:26 出处:网络
So I have been really struggling to grasp the concept, but I am making progress :) Anywa开发者_开发问答y I have a question, using the Service/Repository/UnitOfWork/EF 4 w/POCOS approach.

So I have been really struggling to grasp the concept, but I am making progress :)

Anywa开发者_开发问答y I have a question, using the Service/Repository/UnitOfWork/EF 4 w/POCOS approach.

My MVC app can reference my Repository layer, that References System.Data.Entity, to setup the bindings in Ninject to the concrete classes that live there, and as long as I use Interface driven design, that does not tie my MVC app to EF. Correct?

Just by referencing an assembly that references System.Data.Entity, you are not tying your MVC application to EF?

If I am wrong, can someone please tell me how to bind the interfaces to the concrete classes of the repository and unitfowork in the Ninject Module in the MVC app.

Make any sense?


Just by referencing an assembly that references System.Data.Entity, you are not tying your MVC application to EF?

Yes, you are tying it but that shouldn't bother you. The MVC application is the Host application, it is where all layers and assemblies need to be aggregated into a final product that is deployed on a web server and just works. Jeffrey Palermo has a nice blog post about onion architecture you might take a look at. In this pattern outer layers of the onion know about the inner layers but not the opposite (inner layers shouldn't know about the outer layers). The ASP.NET MVC application is the outermost layer. Then you could simply change the outer layer with some other Host application (for example WPF) and reuse the inner layers.

0

精彩评论

暂无评论...
验证码 换一张
取 消