Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 43619 invoked from network); 1 Sep 2004 13:12:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Sep 2004 13:12:20 -0000 Received: (qmail 86499 invoked by uid 500); 1 Sep 2004 13:11:54 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 86293 invoked by uid 500); 1 Sep 2004 13:11:52 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 86275 invoked by uid 99); 1 Sep 2004 13:11:52 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of yves.sy@gmail.com designates 64.233.170.200 as permitted sender) Received: from [64.233.170.200] (HELO mproxy.gmail.com) (64.233.170.200) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 01 Sep 2004 06:11:51 -0700 Received: by mproxy.gmail.com with SMTP id 79so249153rnk for ; Wed, 01 Sep 2004 06:11:48 -0700 (PDT) Received: by 10.38.83.80 with SMTP id g80mr1495707rnb; Wed, 01 Sep 2004 06:11:48 -0700 (PDT) Received: by 10.38.15.46 with HTTP; Wed, 1 Sep 2004 06:11:48 -0700 (PDT) Message-ID: <6d60515a04090106116c348c08@mail.gmail.com> Date: Wed, 1 Sep 2004 21:11:48 +0800 From: Yves Sy Reply-To: Yves Sy To: Struts Users Mailing List Subject: Re: Action Class Reusable In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, Some action classes can be made reusable, such as actions that add attachments. You have to try to make your code as generic as possible in these actions and simply define a different path in the forward of the corresponding ActionMapping. But these are generally rare cases. Often times, its advisable to create an Action class for each "transaction" you can do from a page (such as clicking links and buttons). This design makes Action classes easier to maintain. Having one action class handle everything in a module can make things very complicated. Grouping similar transactions such as CRUD actions on a certain module is a different thing. For that you can use DispatchAction. It is up to the developer to figure out which transactions can be logically be grouped together using DispatchAction and which should be separated in plain old Actions. Finally, business logic should never be coupled with your Action classes. Your action classes should simply do some synctactic validation (if your not using validate() in the ActionForm or DynaValidatorForms) and point execution to the right direction and not much else. -Yves- 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? > > Thanks, > -Jitesh > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > -- For me to poop on! http://www.formetopoopon.com http://www.nbc.com/nbc/Late_Night_with_Conan_O'Brien/video/triumph.shtml --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org