You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Don Brown <mr...@twdata.org> on 2004/07/06 07:45:09 UTC

Simplifying Struts

With my extra day off today, I took a look at ways to simplify Struts.  
Having been impressed by the simplicity of NanoWeb, I particularly 
looked at ways to change the Struts concept of Actions and 
ActionForwards to support POJO's and configurations that allow new 
actions to be written without requiring any changes to 
struts-config.xml.  I described my findings in my weblog: 
http://www.jroller.com/page/mrdon/20040706#zero_configuration_with_struts

What does the Struts developer community think of providing direct 
support for regular JavaBeans as actions?  One feature of JSF I liked 
was how actions were simply no-arg methods on a JavaBean, making them 
easy to write and test.

Incidently, I built my extension off struts-chain, so it works 
side-by-side regular Struts actions, forwards, and forms.  With 
commons-chain out of the sandbox and Struts 1.2.1 around the corner 
(thanks Ted), I think it is time to start integrating struts-chain into 
the core.

Don

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


Re: Simplifying Struts

Posted by Craig McClanahan <cr...@apache.org>.
Don Brown wrote:

> With my extra day off today, I took a look at ways to simplify 
> Struts.  Having been impressed by the simplicity of NanoWeb, I 
> particularly looked at ways to change the Struts concept of Actions 
> and ActionForwards to support POJO's and configurations that allow new 
> actions to be written without requiring any changes to 
> struts-config.xml.  I described my findings in my weblog: 
> http://www.jroller.com/page/mrdon/20040706#zero_configuration_with_struts
>
> What does the Struts developer community think of providing direct 
> support for regular JavaBeans as actions?  One feature of JSF I liked 
> was how actions were simply no-arg methods on a JavaBean, making them 
> easy to write and test.


It's one of my favorite features too :-).

Indeed, one possible avenue for further development would be to start 
with the infrastructure that JSF provides (managed beans, method and 
value bindings, perhaps navigation) and glue on the controller piece for 
higher level management of business logic and transactions.  JSF 
components can be view-technology independent fairly easily (Hans 
Bergsten's book shows two different approaches to writing your own 
ViewHandler, for example).  And, doing this would let you architect 
things the way WebWork does if you like that (an "action" in their world 
is essentially our Action + ActionForm in one class, instantitated per 
request).

>
> Incidently, I built my extension off struts-chain, so it works 
> side-by-side regular Struts actions, forwards, and forms.  With 
> commons-chain out of the sandbox and Struts 1.2.1 around the corner 
> (thanks Ted), I think it is time to start integrating struts-chain 
> into the core.
>
+1.  We need that for first-class portlet support as well.

> Don

Craig


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


Re: Simplifying Struts

Posted by Vic Cekvenich <ce...@portalvu.com>.
I like it.
.V

Don Brown wrote:
> With my extra day off today, I took a look at ways to simplify Struts.  
> Having been impressed by the simplicity of NanoWeb, I particularly 
> looked at ways to change the Struts concept of Actions and 
> ActionForwards to support POJO's and configurations that allow new 
> actions to be written without requiring any changes to 
> struts-config.xml.  I described my findings in my weblog: 
> http://www.jroller.com/page/mrdon/20040706#zero_configuration_with_struts
> renglish@spinalsolutionsinc.com
> What does the Struts developer community think of providing direct 
> support for regular JavaBeans as actions?  One feature of JSF I liked 
> was how actions were simply no-arg methods on a JavaBean, making them 
> easy to write and test.
> 
> Incidently, I built my extension off struts-chain, so it works 
> side-by-side regular Struts actions, forwards, and forms.  With 
> commons-chain out of the sandbox and Struts 1.2.1 around the corner 
> (thanks Ted), I think it is time to start integrating struts-chain into 
> the core.
> 
> Don


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


Re: Simplifying Struts

Posted by Ted Husted <hu...@apache.org>.
Another approach to simplifying Struts would be to add more flexibility to the struts-config. One patch I'd love to apply would provide the "extends" capability found in Tiles to all the Struts elements. This would suck a lot of the redundant, bug-generating redundancy [:)] out of larger modules. 

Another patch I'd like to see is support for including a properties file, a la Ant and iBATIS. People could then use ${properties} in the Struts config -- another redundancy killer [:)] 

A very cool usage would be to import that same properties file into the Struts config and your source code, which might yield a way to share tokens like "success" and "failure" -- jumping the XML gap.

-Ted. 


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


Re: Simplifying Struts

Posted by David Graham <gr...@yahoo.com>.
--- Don Brown <mr...@twdata.org> wrote:
> With my extra day off today, I took a look at ways to simplify Struts.  
> Having been impressed by the simplicity of NanoWeb, I particularly 
> looked at ways to change the Struts concept of Actions and 
> ActionForwards to support POJO's and configurations that allow new 
> actions to be written without requiring any changes to 
> struts-config.xml.  I described my findings in my weblog: 
>
http://www.jroller.com/page/mrdon/20040706#zero_configuration_with_struts
> 
> What does the Struts developer community think of providing direct 
> support for regular JavaBeans as actions?  One feature of JSF I liked 
> was how actions were simply no-arg methods on a JavaBean, making them 
> easy to write and test.

I think it's a great idea.  Similarly, Commons Validator lets you specify
your validation interface in xml, giving you maximum flexibility instead
of requiring you to extend a base class.  Requiring users to extend Action
and ActionForm has been a sticking point for some in the adoption of
Struts so anything we can do to simplify the usage earns a +1 from me.

> 
> Incidently, I built my extension off struts-chain, so it works 
> side-by-side regular Struts actions, forwards, and forms.  With 
> commons-chain out of the sandbox and Struts 1.2.1 around the corner 
> (thanks Ted), I think it is time to start integrating struts-chain into 
> the core.

A big +1 :-).

David


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


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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