Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MVC With Action Classes - is it possible?

 
Nick Kerr
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Has anyone implemented the MVC pattern making use of Action classes? I would prefer to use Action classes over anonymous inner classes since Action classes can be created by a Factory and can easily enable or disable multiple UI components when the Action is enabled/disabled.

All of the example MVC code that I find on the Web and JavaRanch seems to provide ActionListener hooks in the View that allow the Controller to register its ActionListeners. The problem here is that if I add an Action as an ActionListener, I will not have the ability to enable/disable UI components by simply enabling/disabling the Action.

Is it possible to create a good MVC design and still use Action classes? If so, how?
[ August 15, 2006: Message edited by: Nick ]
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello "Nick",

Welcome to JavaRanch.

On your way in you may have missed that we have a JavaRanch Naming Policy for displayed (screen) names. Your displayed name must consist of a first name (or an initial), a space, and a family name (in that order) and not be obviously fictitious. Since yours, "Nick" does not conform with it, please take a moment to change it, which you can do right here.

Posters with nonconforming displayed names will be locked out of JavaRanch after a few posts using those names.

Thanks
-Barry

(NR) - search tag
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic