ASP.NET N 层/DDD 架构和 Window 服务软件架构之间有区别吗?
我正在阅读大量架构(N 层和 DDD),但大多数文章都是关于网站架构并主要开发 Windows 服务。
该架构可以以同样的方式使用吗?
I am reading a lot of architecture (N-Layered and DDD) yet most of the articles are about web site architecture and develop mostly windows services.
Can the architecture be used the same way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
软件架构中“层”的主要目标是分离关注点;您的程序逻辑应该与数据持久性和用户界面分开。
Windows 服务不会有 UI,但您仍然可以通过逻辑分离功能来提高效率、可支持性并减少未来更改的影响。例如:
因此,您读到的大多数 Web 体系结构概念都可以应用,并且大多数工具也可以用于 Windows 服务。
The primary goal of "layers" in software architectures are to separate concerns; your program logic should be separate from your data persistence, and from your user interface.
A Windows Service will not have a UI, but you can still gain efficiency, supportability and reduce the impact of future changes by separating your functionality logically. For example:
So most of the Web architecture concepts you read about can be applied, and most of the tools can be used for Windows services as well.
当然可以,但 Windows 服务可能没有太多 UI 层(如果有的话)。只是一个轻量级的 runnner 方法左右。
Yes of course, except the Windows Service will likely not have much of a UI tier, if at all. Just a lightweight runnner method or so.
尽管服务有所不同,因为它们没有 UI 元素,但是有一些方法可以使用适用于(N 层、DDD)的原则,即开发原则。
因此,对于例如服务共享架构和合同,而不是类,即它们是在接口上设计的,因此 Windows 服务可以是基于 REST 的服务以及 WCF 服务,但它也可以调用下面的存储库。
Although the services are different as they do not have a UI element to them, however there are ways to use the principles that apply in (N-Layered, DDD) i.e. development principles.
So for e.g. Services Share Schema and Contract, Not Class i.e. they are designed on Interfaces so a windows service can be a REST BASED service as well as a WCF Service but than again it can also call a repository underneath.