Model View Controller

  • Model View Controller
  • Refactoring to Model View Controller
  • Observer
  • Refactoring to Model View Controller with Observer

Reading instructions

Applying UML and Patterns: Applying UML and Patterns:

  • 33 - Architectural Analysis
  • 34 - Logical Architecture Refinement
  • 35 - More Object Design with GoF Patterns (Observer)
  • 38 - Designing a Persistance Framework with Patterns
  • 39 - Documenting Architecture UML & the N+1 View Model

Materials

Model View Controller

Refactoring of the Dice Game into a Model - View - Controller Architecture

Model-View Dice Game Source Code on GitHub

Observer Pattern

Refactoring of the MVC Dice Game to using Observer

Model-View Dice Game Source Code on GitHub

Extracurricular

Videos

Focus on the MVC Style/Pattern

Observer Pattern

I think the Observable - Observer is a bit confusing Publisher-Subscriber vocabulary tends to be easier to understand. In practice having an interface for the Publisher (IObservable) is not that practical as you get a generic update-method and this is too course grained (can be solved using generics - but again too complex to reuse ~5 lines of code). Prefer a specific Observer interface desigened to meet your needs, and just implement the publisher functionality.

Reading

There are several different flavors of GUI Architectures and flavors of the MVC pattern used throughout the years. You can read more about them here. Martin Fowler on GUI Architectures

A study of the main flavors of MV-patterns, MVC, MVP and MVVM (you should probably access the article throug UB's Link to IEEE Xplore) A Journey through the Land of Model-View-Design Patterns