N层架构有什么好处?

发布于 2024-08-29 00:58:01 字数 30 浏览 4 评论 0原文

N层架构有什么好处?这如何使应用程序变得更好?

What are the benefits of an N-layered architecture? How does that make an application better?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

扶醉桌前 2024-09-05 00:58:01

来自此处

  • 其他应用程序将能够重用您的图层公开的功能。
  • 您将能够将层分布在多个物理层上。这可以通过提高性能(有时)、可扩展性和容错能力来极大地影响您的应用程序。
  • 由于层之间的耦合度较低,应用程序的维护更加容易。
  • 向您的应用程序添加更多功能变得更加容易。
  • 层使您的应用程序更具可测试性。
  • 构建结构良好的层可以使应用程序中的定位更加容易。
  • 让您的应用程序不分层意味着您必须在一个地方处理所有安全威胁,这是非常困难的。将应用程序分布到层可以使设计和实施变得更加容易。
  • 如果没有良好的部署计划,在分布式计算中将层分布到多个物理层上并非易事。创建分布式应用程序时,您需要提前规划各层。

From here:

  • Other applications will be able to reuse the functionality exposed by your layers.
  • You will be able to distribute your layers over multiple physical tiers. This can greatly impact your application by improving performance (sometimes), scalability, and fault tolerance.
  • The maintenance of your application is easier because of the low coupling between layers.
  • Adding more functionality to your application is made easier.
  • Layers make your application more testable.
  • Building a well formed layers makes the orientation in your application more easier.
  • Having your application not layered means that you have to deal with all security threats in one place which is very difficult. Having your application distributed to layers makes it much easier to design and implement
  • Without a good deployment plan, distributing your layers over multiple physical tiers in distributed computing is not trivial. You need to plan ahead your layers when you create a distributed application.
满地尘埃落定 2024-09-05 00:58:01

由于层之间的低耦合、层之间的高内聚性以及切换层接口的不同实现的能力,解决方案的维护和增强变得更加容易。

其他解决方案应该能够重用各个层公开的功能,特别是如果层接口的设计考虑到重用的话。

如果工作可以分布在层边界,则分布式开发会更容易。

将这些层分布在多个物理层上可以提高可扩展性、容错性和性能。有关详细信息,请参阅分层分发模式。

可测试性得益于良好定义的层接口以及切换层接口的各种实现的能力。

总结

好处是

  1. 层的重用
  2. 支持标准化
  3. 依赖关系保留在本地
  4. 可交换性

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

  1. Reuse of layers
  2. Support for standardization
  3. Dependencies are kept local
  4. Exchangeability
云淡月浅 2024-09-05 00:58:01

首先,分层架构是“模块化设计”的一种。因此,为了理解分层架构的好处,我们需要知道什么是模块化设计。其次,它是一种特殊类型的模块化设计,专门组织管理依赖关系,以最大限度地减少紧密耦合,从而实现模块化设计的目标——自治模型/组件。与架构/设计不是模块化的情况相比,当我们拥有自主/独立的模块时,它们可以被重用、扩展、测试等。

我有一篇关于分层架构的文章,其中我更详细地讨论了这些事情。这可能会有帮助。

分层架构解释

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文