I'm currently writing a small application following the MVC model I have a Controller class which initiates the Model and View classes. The Controller class consists of several inner private classes that are subclasses of AbstractAction
used for responding to GUI events, setting Icons and mnemonics.
Now my problem is that this class is already getting big, I have about 300 lines of code for 7 Action classes, so I'm thinking about splitting the Controller and put these Action classes into their own files, adding them to a new controller.actions
package.
However, the Actions need to be aware of the model and views, in other words, all of the things that the Controller already does, which was my reason for putting them as inner classes to the Controller in the first place. If I make them separate classes, I will have to have a reference to the Controller somehow (passing to the constructor or making a new abstract base class for the Actions).
Is it a good idea to expose the Actions in separate classes? If so, how should I let them know what the Controller now knows? Or should I keep them as inner, private classes? Or any other solution?