I'm creating my first "bigger" application in Java. As MVC is only pattern I know, I decided to use it. But there's something wrong with this concept.
For example. I need an Action
(or generally event) fired from 2 places (from Button
in frame and MenuItem
). It has to do changes in at least 2 places and in the model.
I've got some ideas, but they seem wrong:
- Pass the controller object to every view element, so newly created actions could use controller's methods to modify rest of the application.
- Make controller static (for same reasons)
- Make controller only model listener
Please tell me how to build it. Or give me some links to some easy to analyse applications.
Source of my project is here, if anyone wants to have a look: https://github.com/Arrvi/ColorExtractor