其他分享
首页 > 其他分享> > 3.2 Dependencies of the Projects in the Solution 解决方案中项目间的依赖项

3.2 Dependencies of the Projects in the Solution 解决方案中项目间的依赖项

作者:互联网

3.2 Dependencies of the Projects in the Solution 解决方案中项目间的依赖项

The diagram below shows the essential dependencies (project references) between the projects in the solution (IssueTracking.part is not shown to be simple)
解决方案中各项目之间的基本依赖关系(项目引用关系)(为了简化IssueTracking.部分没有显示):
image
The projects have been explained before. Now, we can explain the reasons of the dependencies;
前面我们已经解释过这些项目。现在,我们可以解释这些依赖项的原因。

Dashed Dependencies 隐含的依赖项

When you investigate the solution, you will see two more dependencies shown with the dashed lines in the figure above. Web project depends on the Application and EntityFrameworkCore projects which theoretically should not be like that but actually it is.
当你调查这个解决方案时,你会看到还有两个依赖关系,在上图中用虚线表示。Web项目依赖于Application项目和EntityFrameworkCore项目,理论上不应该是这样,但实际上是这样。
This is because the Web is the final project that runs and hosts the application and the application needs the implementations of the Application Services and the Repositories while running.
这是因为 Web项目是运行和托管应用程序的最终项目,应用程序在运行时需要应用服务和存储库的实现
This design decision potentially allows you to use Entities and EF Core objects in the Presentation Layer which should be strictly avoided. However, we find the alternative designs over complicated. Here, two of the alternatives if you want to remove this dependency;
这个设计决定有可能让你在表现层中使用实体和EF核心对象,这应该是严格避免的。然而,我们发现替代设计过于复杂。在这里,如果你想消除这种依赖关系,有两个备选方案:

标签:Web,Domain,Contracts,Solution,Application,depends,Dependencies,3.2,Shared
来源: https://www.cnblogs.com/tjubuntu/p/15419478.html