MVC (Model-View-Controller) ਇੱਕ ਆਰਕੀਟੈਕਚਰਲ ਪੈਟਰਨ ਹੈ ਜੋ ਇੱਕ ਐਪਲੀਕੇਸ਼ਨ ਨੂੰ ਤਿੰਨ ਹਿੱਸਿਆਂ ਵਿੱਚ ਵੰਡਦਾ ਹੈ — Model (ਡੇਟਾ/ਲਾਜਿਕ), View (UI/ਪ੍ਰਸਤੁਤੀ), ਅਤੇ 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)
