开发者

Entity Framework 4.0 changes in NopCommerce 1.90

开发者 https://www.devze.com 2023-03-04 15:45 出处:网络
For learning EF, I was after a good example and I reached NopCommerce via google. I loved their implementation of EF a开发者_如何转开发nd it\'s architecture in version 1.80.

For learning EF, I was after a good example and I reached NopCommerce via google. I loved their implementation of EF a开发者_如何转开发nd it's architecture in version 1.80.

I was very impressed with the Entity Framework Architecture in version 1.80. I liked the way of creating AspNetObjectContextManager and accessing the same objectContext for the request.

But now when I downloaded nopcommerce 1.90, I see all the classes AspNetOCM, ObjectContextHelper, ObjectContextManager, etc.. are removed and context is added to the Service classes (e.g. CustomerService).

Can I please know the reason behind it and if there are any shortcoming in the version 1.80's Entity Framework Architecture.

The reason I am concerned is that I don't want to learn the architecture with some shortcomings. I know NopCommerce development team have always maintained high level of quality in their coding, but I would love to know the reason behind removing the classes from version 1.90


I think this change relates to introduction of IoC/DI (inversion of control / dependency injection) pattern in 1.90.

This pattern enables you to set a service interface implementation (e.g. MyCustomerService for ICustomerService) in a config file, which contributes to loose coupling between client and service implementation(s).

However I've never tried NopCommerce 1.80, so can't tell what were the disadvantages of its architecture.

0

精彩评论

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