Actions: annotations vs. command library

  3 posts   Feedicon  
Replies: 2 - Last Post: April 29, 2010 13:50
by: mthornton
showing 1 - 3 of 3
 
Posted: April 14, 2010 13:13 by kwutzke
Hello,

I am wondering for some time now:

Why were actions implemented using annotations and not via a command library, as used in GoF's Command pattern?

I know it might have collided a little with Java's Action API, but that in fact rather acts as a model for all the GUI components that you attach to them IMHO.

AFAIK you gain nothing by tagging methods as an action. Because reflection is used (please correct me if I'm wrong), you cannot make use of the method return type (again correct me).

What were the design decisions here? I'd like to get a little more insight to the chosen approach.

Karsten
 
Posted: April 27, 2010 17:50 by Eric Heumann
Hey Karsten,

I'm not at all familiar with the Command pattern. I also do not know who first had the idea of the @Action annotation (in any case, they're probably off working for Adobe now or something). In general, I don't really know enough to answer your question correctly, and given the lack of responses to your post, I think some other people around here might be in the same boat as me.

If you're having trouble implementing something using the @Action annotation, and if you give us an example, we could probably offer you some help in doing so, but otherwise I'm not sure where to point you for an answer.

Sorry, wish I could be of more help,

Eric
 
Posted: April 29, 2010 13:50 by mthornton
The Action instances do follow the command pattern. Creating them using annotations and reflection tends to be faster than using lots of small (anonymous) classes and simpler for the developer.
Replies: 2 - Last Post: April 29, 2010 13:50
by: mthornton
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close