What relationship between MVC and Project Standards?

3

We know that the Model View Controller (MVC) is not a Design Pattern, but architecture standard. It is also not a layered pattern, as this tells you how to group components while MVC tells you how components interact.

MVC uses some standards. What Project Patterns does MVC use?

    
asked by anonymous 03.06.2015 / 15:50

1 answer

2
In the Design Patterns: Elements of Reusable Object-Oriented Software book, considered the Desing Patterns bible, the MVC standard in the Smalltalk language is quoted. According to the book, the MVC standard uses the following design patterns:

Observer

Used in the View decoupling of the Models so that changes in the Model reflect on all Views.

Composite

Used to use nested Views and creating complex components as controls.

Strategy

Used in the View - Controller relationship. By changing the controller instance that the view responds, you change the view manipulation strategy.

The book also cites the following design patterns that can be used in MVC, but are somewhat specific to the Smalltalk implementation to which the book refers.

Factory Method - Can be used to set the default instance of a Controller to a View.

Decorator - To add scrolling to a View

You can read here that specifically speaks of this.

However, each specific MVC implementation will use one or more Design Patterns more or less. For example, ASP.NET MVC uses something very close to the Command pattern when using ActionResult on return. Different returns like JsonResult , ViewResult or PartiaViewResult reprent different commands that will be executed by the framework on the return of the control.

    
03.06.2015 / 16:27