You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Joe Germuska <Jo...@Germuska.com> on 2005/05/31 16:39:53 UTC

ActionConfig/ActionMapping question

I've generally been attempting to code to the newer "config" APIs 
instead of the older not-quite-deprecated forms, and I just hit 
something I didn't expect; I don't know whether it qualifies as a bug 
or just my own misunderstanding.

When one has an object of type "ActionConfig", there is a method, 
"findForwardConfig".  This method looks in the actionConfig's map of 
ForwardConfig objects and returns a match or null.

However, there is no method which captures the behavior of 
ActionMapping.findForward(String), which searches not only the local 
collection of ForwardConfig objects but also the global scope.

Should ActionConfig have a method which does something like this? I 
would propose altering the behavior of findForwardConfig to also go a 
"global" search as a fallback, because I believe the name "find*" 
implies more behavior.  If there is need for a method which only 
searches the local scope, I would propose that method be named 
"getForwardConfig(String)"

Is this too incompatible to introduce directly as described?  Does 
there need to be a new method which behaves as 
"ActionMapping.findForward" but which presumably returns ActionConfig 
instead of ActionMapping?  My assumption is that vanishingly few 
people write to the newer APIs; maybe I'm wasting my time doing it 
myself.

Joe

-- 
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: ActionConfig/ActionMapping question

Posted by Hubert Rabago <hr...@gmail.com>.
I'm not aware of the motivations behind the newer config objects.  The
closest I have to a clue is someone mentioning in a previous email
that the config objects were supposed to just hold data from the
struts-config.xml file.  If that's still the case, then (1) we should
reduce the logic placed there (2) stop adding more methods with more
logic.  What that means is more util-type classes to hold the logic
and pass config classes to them.  For (1), an obvious target would be
the config inheritance.  They can be moved to a separate class which
will contain all inheritance logic.  The findForward(String) type
methods would move to a separate class also.  Of course, all this
hangs on the reason we have the newer "config" API in the first place.
 Can anyone point me to a thread or provide some clarification?

Hubert


On 5/31/05, Joe Germuska <Jo...@germuska.com> wrote:
> I've generally been attempting to code to the newer "config" APIs
> instead of the older not-quite-deprecated forms, and I just hit
> something I didn't expect; I don't know whether it qualifies as a bug
> or just my own misunderstanding.
> 
> When one has an object of type "ActionConfig", there is a method,
> "findForwardConfig".  This method looks in the actionConfig's map of
> ForwardConfig objects and returns a match or null.
> 
> However, there is no method which captures the behavior of
> ActionMapping.findForward(String), which searches not only the local
> collection of ForwardConfig objects but also the global scope.
> 
> Should ActionConfig have a method which does something like this? I
> would propose altering the behavior of findForwardConfig to also go a
> "global" search as a fallback, because I believe the name "find*"
> implies more behavior.  If there is need for a method which only
> searches the local scope, I would propose that method be named
> "getForwardConfig(String)"
> 
> Is this too incompatible to introduce directly as described?  Does
> there need to be a new method which behaves as
> "ActionMapping.findForward" but which presumably returns ActionConfig
> instead of ActionMapping?  My assumption is that vanishingly few
> people write to the newer APIs; maybe I'm wasting my time doing it
> myself.
> 
> Joe
> 
> --
> Joe Germuska
> Joe@Germuska.com
> http://blog.germuska.com
> "Narrow minds are weapons made for mass destruction"  -The Ex
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org