Skip to content

tmscarla/mvc-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MVC

Implementation of the architectural pattern Model View Controller through the composition of the design patterns Observer, Strategy and Composite.

Overview

According to Wikipedia, the Model–view–controller (MVC) is a software architectural pattern commonly used for developing user interfaces that divides an application into three interconnected parts. This is done to separate internal representations of information from the ways information is presented to, and accepted from, the user. The MVC design pattern decouples these major components allowing for efficient code reuse and parallel development.

  • The model is the central component of the pattern. It expresses the application's behavior in terms of the problem domain, independent of the user interface. It directly manages the data, logic and rules of the application.
  • A view can be any output representation of information, such as a chart or a diagram. Multiple views of the same information are possible, such as a bar chart for management and a tabular view for accountants.
  • The third part or section, the controller, accepts input and converts it to commands for the model or view

A Design Pattern Composition

We can think at the MVC as a composition of three different design patterns. Taking a closer look to these components:

  • Model uses the Observer pattern to keep controllers synchronized with its state.
  • View and Controller use the Strategy pattern: we can think at View as a context where all the controllers, which encapsulate a particular behaviour, can operate.
  • View also uses internally the Composite pattern to handle in a uniform way all the elements that make up the interface.

Implementation

Here it is shown only the UML class diagram of the design choice. For further implementation details please refer to the document Relazione.pdf, although in italian.

Image

About

Implementation of the architectural pattern Model View Controller through the composition of the design patterns Observer, Strategy and Composite.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages