开发者

Unity vs EntLib?

开发者 https://www.devze.com 2023-01-31 10:43 出处:网络
I\'ve been using EntLib for some time, and have re开发者_如何转开发cently found Unity.At first glance it looks like it handles most everything that EntLib does, but seemingly lighter-weight.

I've been using EntLib for some time, and have re开发者_如何转开发cently found Unity. At first glance it looks like it handles most everything that EntLib does, but seemingly lighter-weight.

Which is recommended for day, MVVM architecture, and pros/cons of one over the other?

Thanks.


Unity is a dependency injection container with support for interception. EntLib is a library of 9 application blocks, one of which is Unity. EntLib has a much broader scope, it handles other cross-cutting concerns - think of logging, validation, exception management, data access, caching, etc.

Back in 2008 when we were designing Unity during our work on EntLib4.0, we quickly realized that it is something that many developers can benefit from by itself. That's why we shipped it standalone.

EntLib5.0 is fully DI-driven, and it uses Unity container by default. You can swap it out for another container if you wish. The same goes for Prism, which is container-agnostic. If EntLib was designed to be leveraged in any layer of your app, Prism was designed specifically for building composite UIs (in WPF and Silverlight). EntLib and Prism are complementary, not overlapping.


Unity is a dependency injection container and its own application block; whereas EntLib is a grouping of application blocks which Unity could in theory be part of.

You also have Prism which wraps Unity/EntLib and varying blocks to produce a buffet of varying blocks geared towards MVVM development in both Silverlight and WPF.

Initially I would say head towards making use of Prism as you will already be familiar with EntLib and can make use of Unity as your DI container. Prism also easily lets you use what you need and ignore what you don't from the varying blocks.

0

精彩评论

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

关注公众号