MVC (Model-View-Controller) هو نمط معماري يفصل التطبيق إلى ثلاثة أجزاء — Model (البيانات/المنطق)، View (واجهة المستخدم/العرض)، و Controller (يتعامل مع المدخلات، التنسيق) — مما يعزز فصل الاهتمامات. إنه نمط أساسي، مع العديد من الاختلافات (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)
