cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <>
Subject [PROPOSAL] mulitple actions per class
Date Tue, 12 Feb 2002 13:34:26 GMT
While working with actions something bugs me more and more... For each
very simple action you need to have a new class. Although it might be just
a few lines for each, it becomes really ugly when you share code with
other actions or need to call an action from an action. Plus having
thousand of action class for a single webapp. Sure this all possible and
one can say:  then use helper classes that hold all the shared code. But
well - possible does not mean confortable.

IIRC with Turbine e.g. it is way more confortable. They use
"methods as actions":

  class SomeActions {

    public void doMyAction(..) {

(I'm not quite sure about the arguments and stuff though)
This helps to have all related code at a glance.
Although I'm not yet sure what syntax should be prefered

1.  <map:action type="SomeActions.doMyAction">
    <!-- directly use the method -->

2.  <map:action type="SomeActions.MyAction">
    <!-- have a fix prefix like "do" -->

3.  <map:action type="SomeActions" method="doMyAction">

4.  <map:action type="SomeActions" method="MyAction">

Of course this will require the use of the reflection API
for those actions using the new method syntax. (All others
will not be effected and treated as usual)

I have made some tests: if we use some intelligent
caching for the reflection API there will be only little
to no performance loss compared to the old mechanism.

What do guys think?

To unsubscribe, e-mail:
For additional commands, email:

View raw message