开放式和封闭式分层架构是什么意思?

发布于 2024-07-22 00:08:53 字数 1431 浏览 6 评论 0原文

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

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

发布评论

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

评论(2

不可一世的女人 2024-07-29 00:08:53

以下是 Bob Martin 对开放式和封闭式架构的最早定义之一:

http://www .objectmentor.com/resources/articles/ocp.pdf

根据定义,开放架构正在发生变化。 它们很难维护,因为在设计 API 时很难预见未来并预测每一个可能的需求。 但是,如果 API 保持不变,并且您已经设计了通过添加而不是重写进行修改的有效机制(例如声明性配置、数据驱动的应用程序),那么开放架构可能会非常有效。

对于那些众所周知且相对静态的问题,封闭式架构并没有什么问题。 开放并不总是必要的。 选择与变化的性质和速度有关。

Here's one of the earliest definitions of open and closed architectures from Bob Martin:

http://www.objectmentor.com/resources/articles/ocp.pdf

Open architectures, by definition, are changing. They're hard to maintain because it's difficult to see into the future when designing the API and anticipate every possible need. But if the API remains constant, and you've designed effective mechanisms for modifying by addition rather than rewriting (e.g. declarative configuration, data-driven applicatons), open architectures can be very effective.

There's nothing wrong with a closed architecture for those problems that are well known and relatively static. Open isn't always necessary. The choice has to do with the nature and rate of change.

北斗星光 2024-07-29 00:08:53

封闭分层架构意味着任何给定层(或层)只能使用下一个直接层的服务,而在开放层架构中,给定层可以使用其下面的任何层(或层)。 封闭层架构通过减少依赖性来促进层之间的独立性。

A closed layered architecture means that any given layer (or tier) can only use the services of the next immediate layer, whereas in an open layer architecture a given layer can make use of any of the layers (or tiers) below it. Closed layer architecture promotes independence between layers by reducing dependencies.

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