N层架构有什么好处?
N层架构有什么好处?这如何使应用程序变得更好?
What are the benefits of an N-layered architecture? How does that make an application better?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
N层架构有什么好处?这如何使应用程序变得更好?
What are the benefits of an N-layered architecture? How does that make an application better?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
来自此处:
From here:
由于层之间的低耦合、层之间的高内聚性以及切换层接口的不同实现的能力,解决方案的维护和增强变得更加容易。
其他解决方案应该能够重用各个层公开的功能,特别是如果层接口的设计考虑到重用的话。
如果工作可以分布在层边界,则分布式开发会更容易。
将这些层分布在多个物理层上可以提高可扩展性、容错性和性能。有关详细信息,请参阅分层分发模式。
可测试性得益于良好定义的层接口以及切换层接口的各种实现的能力。
总结
好处是
Maintenance of and enhancements to the solution are easier due to the low coupling between layers, high cohesion between the layers, and the ability to switch out varying implementations of the layer interfaces.
Other solutions should be able to reuse functionality exposed by the various layers, especially if the layer interfaces are designed with reuse in mind.
Distributed development is easier if the work can be distributed at layer boundaries.
Distributing the layers over multiple physical tiers can improve scalability, fault-tolerance, and performance. For more information, see the Tiered Distribution pattern.
Testability benefits from having well-defined layer interfaces as well as the ability to switch out various implementations of the layer interfaces.
Summary
Benifits are
首先,分层架构是“模块化设计”的一种。因此,为了理解分层架构的好处,我们需要知道什么是模块化设计。其次,它是一种特殊类型的模块化设计,专门组织管理依赖关系,以最大限度地减少紧密耦合,从而实现模块化设计的目标——自治模型/组件。与架构/设计不是模块化的情况相比,当我们拥有自主/独立的模块时,它们可以被重用、扩展、测试等。
我有一篇关于分层架构的文章,其中我更详细地讨论了这些事情。这可能会有帮助。
分层架构解释
Firs of all, layered architecture is a type of "Modular Design". Hence, in order to appreciate the benefits of layered architecture, one needs to know what modular design is. Secondly, it is a special type of modular design, specifically organized to manage dependencies in order to minimize tight coupling, thus achieving the objectives of modular design - autonomous modles/components. When we have autonomous/independent modules, then they can be reused, extended, tested, and so on, compared to the case where the architecture/design is not modular.
I have an article about layered architecture, where I discuss these things in more detail. It might be helpful.
Layered Architecture Explained