Why use design patterns?
How does the Singleton pattern work?
Name three creational patterns and their purposes
What are creational patterns?
Patterns focused on object creation
What are the 3 MVC components?
What does the Model do in MVC?
Stores data, Enforces business rules, Notifies View of updates
What is the View’s role in MVC?
Displays data from Model, No business logic, Updates when Model changes
What does the Controller handle?
Processes user input, Updates Model, Refreshes View
Describe MVC flow for a bank transfer
How does MVC improve maintainability?
Changes to one component (e.g View) don’t affect others (Model/Controller)
Name three structural patterns
What are structural patterns?
Patterns dealing with object composition/relationships
What are behaviour patterns?
Patterns managing object communication.
Name three behaviour patterns
Why is MVC easier to test?
Components are isolated
How to make Singleton thread-safe?
Use synchronised in getInstance() or static initialisation
Name an MVC variant
MVVM (Model-View-View-Model) for data-binding (e.g. Angular)
MVC key rules
When should you use design patterns?
When they solve a specific problem - not as a default. Overuse adds complexity
What are design patterns?
Reusable solutions to common software design problems providing structured approaches to improve code readability and flexibility
Advantages of MVC
MVC Flow over Traditional flow
Replaces direct interaction with centralised control (Controller), reducing complexity