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.
精彩评论