« Turn the Page, Revisited: An Updated Book Component for JavaFX | Main | JavaFX Tips and Tricks: Invoking JavaFX Functions from Java »

April 06, 2009



Hi Jim,

I am a big fan of design patterns and transmit my enthusiasm to my students.
MVC is a wonderful architecture but I usually warn my students about the singleton pattern.
I would recommend passing the model as a parameter to each view instead of using a singleton pattern.

Singleton is good for the problem it solves (implementing global variables) but is often overused as it is easy to explain and understand.
Singleton causes many unnecessary dependencies and maintenance nightmares.

In your example, when you will want to have two models in your application, your views won't be able to cope with this new setup.

Interested readers can do a google search on evil singleton:

Thanks for your blog,

The comments to this entry are closed.