I see, but then how do you update your view? Isnt view supposed to update according to the model? do you give this task also to the controller?
Yep, for simple things the Controller just passes it along from the Model to
the View. For more complicated things the Controller should be the destination
of the fired event anyways.
Another thing, Controller is just supposed to handle input right? so then if you would change your controller in an eventhandler this wouldnt be wrong?
I wouldn't be wrong, both the Model and the View generate events and the
Controller catches them all and decides what to do with them.When the View
fires an event the user was the actual cause. When a Model fires an event it
was just because some data changes or some business status has changed.
Let the Controller handle it and update the View/Model whenever necessary.
And what about something called an Observer? i kinda came across this in a powerpoint explaining MVC but have no idea what it is or does.
An Observer is the same as a Listener (in Java speak). The Observer simply
listens for events fired by an Observable. The pure Observer/Observable
implementations in Java are next to useless given the fact that the
PropertyChangeSupport class can handle it in a far more flexible way.
kind regards,
Jos