【发布时间】:2012-08-03 02:45:51
【问题描述】:
我一直在使用我所谓的 Service-Repository-UnitOfWork 模式编写 MVC 应用程序,如下所示:
MVC Controllers --> Services --> Repositories --> EntityFramework
然后
Repositories/EntityFramework (constructs Domain Objects/POCO) --> Services --> Transform to ViewModels --> Controller --> Send the ViewModel/View to the client.
我使用 IoC 容器为服务、存储库和 UnitOfWork 配置接口,这些接口被注入到各种组件的构造函数中。
我的问题是,这与洋葱架构有什么相似之处吗?
这有意义吗?
【问题讨论】:
-
也许您应该阅读 Jeffrey Pallermo 关于他的洋葱架构的文章,以了解这是否匹配:jeffreypalermo.com/blog/the-onion-architecture-part-1。
标签: asp.net-mvc architecture dependency-injection inversion-of-control onion-architecture