นอกเหนือจาก design patterns ระดับออบเจ็กต์แล้ว architectural patterns กำหนดโครงสร้างระดับสูงของแอปพลิเคชัน เช่น layered, hexagonal (ports and adapters), clean architecture และ event-driven มันจัดระเบียบทั้งระบบเพื่อความสามารถในการบำรุงรักษา ทดสอบได้ และยืดหยุ่น
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
