【问题标题】:Is the Onion Architecture similar to the Service-Repository-UnitOfWork pattern?洋葱架构是否类似于 Service-Repository-UnitOfWork 模式?
【发布时间】: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 配置接口,这些接口被注入到各种组件的构造函数中。

我的问题是,这与洋葱架构有什么相似之处吗?

这有意义吗?

【问题讨论】:

标签: asp.net-mvc architecture dependency-injection inversion-of-control onion-architecture


【解决方案1】:

不,不是。这些是来自不同类别的模式。

洋葱架构管理整个解决方案,它与“多层”或“SOA”或“客户端-服务器”处于同一级别。

“服务层”、“存储库”、“UoW”代表实现模式,它们管理应用程序内部的特定部分。

【讨论】:

    猜你喜欢
    • 2011-10-09
    • 1970-01-01
    • 2014-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-22
    • 2015-03-17
    • 1970-01-01
    相关资源
    最近更新 更多