1
我一直在寫MVC應用使用的是我所謂的服務的存儲庫的UnitOfWork模式,它看起來像這樣:洋蔥體系結構是否與Service-Repository-UnitOfWork模式類似?
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配置接口。
我的問題是,這完全類似於洋蔥建築嗎?
這是否有意義?
什麼是洋蔥建築? – 2012-08-03 05:10:51
也許你應該閱讀Jeffrey Pallermo的關於他的Onion Architecture的文章,以確定它是否匹配:http://jeffreypalermo.com/blog/the-onion-architecture-part-1/。 – Steven 2012-08-03 08:34:58