洋葱架构 [英] Onion Architecture
问题描述
我设立为即将到来的内部应用程序试用洋葱架构巴勒莫提出了一个项目结构( http://jeffreypalermo.com/blog/the-onion-architecture-part-3/ )。
I am setting up a project structure for an upcoming internal application trialling the Onion Architecture proposed by Palermo (http://jeffreypalermo.com/blog/the-onion-architecture-part-3/).
我按照他的指引,但是我需要。一些验证该项目迄今为止的结构
I have followed his guidelines, however I need some verification on the structure of the project so far.
图表之前,该问题:
-
我想引用是正确的(设置为每个在这里的箭头表示'有一个参考图)
,但一些验证将是一件好事。
I think the References are all correct (set up as per the diagram where an arrow means 'has a reference to') but some verification would be good.
我应该把我的依赖分辨率层?这其中,
助手去了?这有所有其他项目的参考
What should I put in my dependency resolution layer? Is this where Helpers go? This has a reference to all other projects?
如何在Web服务和放大器?; UI,与DAL沟通? (通过核心是什么?怎么做?)
How do the web services & UI, communicate with the DAL? (Through the core? How?)
我应该去哪里? [宽泛的问题,我知道...]
What should go where? [Broad question I know...]
简化的概念图如下所示(文件夹命名空间代表):
The simplified conceptual diagram is as follows (Folders represent namespaces):
推荐答案
1它看起来不错,但我不知道它是插入依赖性解析到图个好主意。
1 It looks OK but I am not sure it's a good idea to insert dependency resolution into the diagram.
2,我相信依赖注入的东西会在这里。
2 I believe dependency injection stuff would be here.
3它根据巴勒莫图是核心。在内核中,你将有仓库交谈DAL和域模型,以及处理存储库和领域模型的服务(而不是Web服务)。和UI / Web服务将主要谈的服务。
3 It is core according to Palermo's diagram. In core, you will have repositories talking to DAL and domain models, and services (not web services) dealing with repositories and domain models. And UI/web services will mainly talk to services.
4同样,我认为答案是巴勒莫的图。但在我看来,组织的项目是不同的,琐碎的时候有架构的充分理解。
4 Again, I think the answer is in Palermo's diagram. But in my opinion, organizing projects can be different and trivial when there is full understanding of the architecture.
洋葱架构变得明显,我一旦我了解DDD和必要的设计模式如MVC,依赖注入,存储库/服务,ORM。
Onion architecture became obvious to me once I understood DDD and necessary design patterns such as MVC, Dependency injection, Repository/Service, ORM.
这篇关于洋葱架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!