MVC (Model-View-Controller) เป็น architectural pattern ที่แยกแอปพลิเคชันออกเป็นสามส่วน ได้แก่ Model (ข้อมูล/logic), View (UI/การแสดงผล) และ Controller (จัดการ input ประสานงาน) ส่งเสริม separation of concerns มันเป็นพื้นฐานและมีรูปแบบที่หลากหลาย (MVP, MVVM)
องค์ประกอบสามส่วน
MODEL → data and business LOGIC (the core: data, rules, state) — independent of the UI
VIEW → the UI/PRESENTATION (displays data to the user) — what the user sees
CONTROLLER → handles user INPUT, coordinates between Model and View (processes requests,
updates the model, selects the view)
→ SEPARATION: data/logic (Model) ≠ presentation (View) ≠ input handling (Controller)
