struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <>
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 <> 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:

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

    Module B Struts Configuration File:

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

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


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

View raw message