struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <craig...@gmail.com>
Subject Re: Action Class Reusable
Date Wed, 01 Sep 2004 17:34:11 GMT
On Wed, 1 Sep 2004 18:13:08 +0530, Jitesh Sinha <jsinha@cisco.com> wrote:
> Hi All,
> 
> Is there a way we can make our Action Classes reusable across different
> modules?
> Generally we have one Action class for every module.Maybe,if we put our
> business logic in different business classes (particular to a module) and
> make these business classes implement a common interface?
> I have only a vague idea till now about this.Can someone elaborate?
> 

While it's really simple to make an Action class reusable:

    Module A Struts Configuration File:

    <struts-config>
      ...
      <action path="/foo" className="com.mypackage.MyAction"/>
      ...
    </struts-config>

    Module B Struts Configuration File:

    <struts-config>
      ...
      <action path="/bar" className="com.mypackage.MyAction"/>
      ...
    </struts-config>

I would suggest that you consider the latter strategy that you
describe (abstract the common business logic into separate business
tier classes) instead.  Among other things, that makes it much easier
to adapt to the reality that, over time, use cases which started out
identical tend to diverge in the details.

> Thanks,
> -Jitesh

Craig

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


Mime
View raw message