软件架构指南
Software Architecture Guide (2019)

原始链接: https://martinfowler.com/architecture/

图形用户界面为用户与软件系统之间提供了丰富的交互方式。这种丰富性管理起来十分复杂,因此,通过深思熟虑的架构来控制这种复杂性至关重要。“表单与控件”模式适用于流程简单的系统,但当系统复杂度增加时,该模式便难以支撑,大多数人会转向“模型-视图-控制器”(MVC)。遗憾的是,MVC 是最容易被误解的架构模式之一。以该名称命名的系统在实现上存在一系列重大差异,有时还会以“应用模型”、“模型-视图-呈现器”、“表示模型”、“MVVM”等名称来描述。理解 MVC 的最佳方式,是将其视为一套包含以下原则的集合:即表现层与领域逻辑的分离,以及通过事件(观察者模式)实现表现层状态的同步。

这篇 Hacker News 讨论帖围绕马丁·福勒(Martin Fowler)的指南,探讨了现代软件架构所面临的挑战。 评论者 YZF 认为,设计高质量系统的能力已成为一种“失传的艺术”。他指出,许多开发者构建的架构只是“凑合能用”——即那些杂乱无章、质量低下的系统,随着时间的推移,其维护成本会越来越高。YZF 进一步警告称,当前的 AI 工具加剧了这一问题,因为它们让开发者能轻易地生成并堆砌出结构糟糕的代码。 相比之下,sroerick 则持相反观点,他认为 AI 生成的“糟粕”泛滥反而迫使开发者更加自律。他认为,由于 AI 能迅速生成低质量模式,这反而凸显了合理架构的必要性,因为拙劣的模式会更快失效。 讨论还简要提及了一些元问题,例如为旧内容添加适当标签(如“[2019]”)的必要性。总体而言,该讨论帖凸显了现代开发工具的便捷性与严谨架构设计持久重要性之间的矛盾。
相关文章

原文

Graphical User Interfaces provide a rich interaction between the user and a software system. Such richness is complex to manage, so it's important to contain that complexity with a thoughtful architecture. The Forms and Controls pattern works well for systems with a simple flow, but as it breaks down under the weight of greater complexity, most people turn to “Model-View-Controller” (MVC). Sadly MVC is one of the most misunderstood architectural patterns around, and systems using that name display a range of important differences, sometimes described under names like Application Model, Model-View-Presenter, Presentation Model, MVVM, and the like. The best way to think of MVC is as set of principles including the separation of presentation from domain logic and synchronizing presentation state through events (the observer pattern).

联系我们 contact @ memedata.com