超越对象级别的设计模式,架构模式定义应用程序的高级结构——如分层、六边形(端口和适配器)、清洁架构和事件驱动。它们组织整个系统以实现可维护性、可测试性和灵活性。
Layered (n-tier) 架构
LAYERED → organize the app into horizontal LAYERS, each with a responsibility:
PRESENTATION (UI) → APPLICATION/business logic → DATA ACCESS → DATABASE
→ each layer depends only on the layer below; clear separation
✓ simple, common, organized ✗ can become rigid; layers can leak; less flexible
