Skip to content

Model View Controller & Observer Pattern in Java FX

Notifications You must be signed in to change notification settings

mjboere/Hello-FX-World

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello-FX-World-MVC-Observer

First Draft to demonstrate how we want the structure of the projects to look like.

This implementation of account (-management) uses the Model View Controller (MVC) pattern to link the classes Thus the view only knows the controller and the controller only knows the model

  • View responsibility = everything to do with the graphics & user interaction
  • Controller responsibility = pass calls to other controllers ( not used here ) and/or make all business decisions
  • Model responsibility = Store data and do some functions purely related to this data.

The Spelbord part implements two other design patterns;

  • Singleton pattern This can be found in the controller package / spelbordController / getInstance method. It ensures there is always only 1 objects of this class alive

  • Observer pattern
    Spelbord is an Observable. It uses the interface SpelbordObservable to force us to write the needed methods : register and notifyAllObservers

    SpelbordView is an observer and uses the abstract class SpelbordObserver to force us to write the update method .

Note : Player scores should not be in Spelbord => They should be in a Player model ( out of time )

Hope this helps!

Michiel Boere

About

Model View Controller & Observer Pattern in Java FX

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published