struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Carreira <>
Subject Re: Returning Result directly (was Re: DefaultActionMapper compatablity
Date Wed, 26 Jul 2006 10:00:32 GMT
> Being able to return Result instances from Actions
> doesn't  
> necessarily mean the lack of reuse of Results.  This
> is equivalent to  
> saying that because it's Java code you can't reuse
> it.  I didn't  
> realize that XML was the solution to lack of reuse in
> OO ;)
> Seriously though, it's not uncommon in Stripes where
> multiple actions  
> have the same resolution to simply factor that out to
> a single method  
> or even a constant sometimes.  Given your CRUD
> example there's no  
> reason you couldn't setup a crud Action with multiple
> methods for add 
> (), update() delete() etc. that also had abstract
> methods for the  
> list-page result and the details-page result.  Then
> not only would  
> you have reuse of your Result information, but you'd
> have all your  
> action/navigational information in one place and
> completely  
> standardized across CRUD beans.
> The approach may not be for everybody, I understand.
>  But sometimes  
> f you let go of the XML and start doing things in
> code, you start to  
> see different approaches that achieve the same goals.
>  I'm sorry if  
> hat sounds condescending.  All I'm trying to do is
> make you think  
> outside of the box you are in as a WW core developer
> (obviously, I  
> have my own box, but that's another story...)
> -t

I understand that there are different ways to skin the cat, but what if I want to reuse my
actions in different contexts? What if I want to call my action from a JBPM workflow? Do I
need to subclass it to override the result that's returned? 

On a side note, have you seen the stuff where people try to do code versions of the configuration
for Spring? It looks horrible, even when they've gone to the effort to try to develop DSL-type
helper methods. 

I don't understand this huge backlash against XML in the Java community. XML has its place.
XML is really good at representing hierarchical structured data. Building up that hierarchy
in Java code isn't nearly as intuitive or understandable (to me). There's definitely ways
to over-do it, but I think it's shifted too far back the other way.
Posted via Jive Forums

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

View raw message