Design Patterns #5 - Three fundamental design patterns, MVC made of.

Design Patterns #5 - Three fundamental design patterns, MVC made of.

The MVC pattern is kind of Compound pattern which made up of three fundamental Design Patterns-?

  • Strategy Design Pattern?
  • Observer Design Pattern?
  • Composite Design Pattern?


Model –?The Model implements the Observer Pattern. Using the Observer Pattern keeps the model completely independent of the views and controller. It allows us to use different views with the same model, or even multiple views at once.??


View –?View uses the composite design pattern. The view is a composite of GUI components (labels, buttons, text entry, etc.). The top level component contains other components, which contains other components, and so on until you get to the leaf nodes.?

When the controller tells the view to update, it only has to tell the top view component, and composite pattern takes care of the rest.?


Controller-?The View and Controller implement the Strategy Pattern. The view is configured with a strategy. The view is concerned only with the visual aspects of the application, and delegates to the controller for any decision about the user interface behavior. Using the strategy pattern also keeps the view decoupled from the model, because it is the controller that is responsible for interacting with the model to carry out the user requests. The view knows nothing about how it gets done.?

No alt text provided for this image


要查看或添加评论,请登录

Anshu Verma的更多文章

社区洞察

其他会员也浏览了