[英]Where to place the Emailer class in the solution?
I have a solution that has the following structure: 我有一个具有以下结构的解决方案:
- My Solution
-- Core
--- Core.Interfaces (DLL)
--- Core.Data (DLL)
--- Core.Business (DLL)
-- Models
--- Models.Enums (DLL)
--- Models.DTOs (DLL)
--- Models.Model (DLL)
-- Clients
--- Client Access (ASP.NET MVC)
--- Management Access (ASP.NET)
Now I have an emailer class (IEmailer and Emailer) that will be used in both clients and mainly in the Core.Business as well, my initial thought is to place it in the Core.Business project. 现在,我有一个电子邮件程序类(IEmailer和Emailer),这两个客户端都将使用它,并且主要在Core.Business中使用,我最初的想法是将其放置在Core.Business项目中。
Is that the logical place for the emailer class? 那是电子邮件程序类的合理位置吗?
I would add IEmailer
to the Core.Interfaces
and Emailer
to a new assembly, something like Infrastructure.Services
. 我将
IEmailer
添加到Core.Interfaces
并将Emailer
添加到新的程序集,例如Infrastructure.Services
。 There isn't much benefit in having the interface and implementation in the same assembly. 在同一程序集中具有接口和实现并没有太大的好处。
Next, I would assure that Core.Business
has no direct dependency on the Infrastructure.Services
assembly, hence on the Emailer
type. 接下来,我将确保
Core.Business
不直接依赖于Infrastructure.Services
程序集,因此不依赖于Emailer
类型。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.