Beyond object-level design patterns, architectural patterns define the high-level structure of applications — like layered, hexagonal (ports and adapters), clean architecture, and event-driven. They organize entire systems for maintainability, testability, and flexibility.
Layered (n-tier) architecture
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
