Model-View-Controller Architecture
# MVC Architecture
# Design Problems
- Tight coupling between UI and application logic
- Observer Pattern: Need for UI to update when state changes
- Strategy Pattern: Need for UI to support different functionalities depending on the user input
View:
- Manage how data is presented
- Observes the Model and updates their graphical representation Model:
- Provides the operations to register and unregister observers
- Implements a notify method to call observers update Controller:
- Captures input and passes them to the view and model
# Pros
- Support for simultaneous development
- Support for multiple views with just 1 Model
- High cohesion: grouping of related actions
- Low coupling
# Cons
- Code navigability
- Maintaining multi-artefact consistency: decomposition of features results in scattering