Action vs Controller



This is a question on architecture.

In java we have two options on how to implement event handling
mechanism.
* First is to subclass AbstractAction, define all action handling
logic within this subclass and then initialize all GUI controls with
an object of this subclass or call setAction on controls.
* Second is to implement MVC pattern and put all action logic and
*any* other handling event logic into the Controller class.

As you can see the only difference between option #1 and option #2 is
that Controller is more versatile that AbstractAction subClass.

I would like to ask your opinion on which option do you think is
better for a generic GUI application? I understand that the decision
highly depends on the exact task, but imagine your task is to develop
quite a small GUI app with just one static JMenuBar and a few GUI
controls on the main JFrame window. Also you would probably want to
develop further in the future.

-R.
.



Relevant Pages

  • Re: wxPython GUI designer
    ... Any view on what you think about using GUI designer tools. ... I use wxGlade all the time, ... I have to add these controls in wxGlade as 'custom' controls. ... To get the best out of wxGlade, you really need to subclass the classes ...
    (comp.lang.python)
  • Re: Action vs Controller
    ... First is to subclass AbstractAction, ... logic within this subclass and then initialize all GUI controls with ... Everything in the GUI world I've seen uses MVC or a related pattern. ... Plus MVC is portable, whereas Swing's action system may not work anywhere else if you have to port your application. ...
    (comp.lang.java.programmer)
  • Re: UserControl Subclassing
    ... I also came across this link where Matthew Curland explains ... He also provides some sample controls on ... Curland also provides a DLL for use in the IDE, ... UC subclass itself. ...
    (microsoft.public.vb.general.discussion)
  • Re: generic message handler
    ... I do not want my controls to know about these ... that the parent of each control is unknown. ... > subclass each window and do the message routing via its message maps. ... > there is probably a way you could hook into MFC's hook processing and ...
    (microsoft.public.vc.mfc)
  • NullReferenceException when subclassing with NativeWindow
    ... To subclass form and controls I use a class ... periodically goes through a cycle when it creates one NativeWindow-descendent ... Int32 msg, IntPtr wparam, IntPtr lparam) ...
    (microsoft.public.dotnet.framework.windowsforms)