My approach has been to limit Struts' knowledge of the app's implementation
details ie EJBs. Thus I use struts actions to hide the HTTP based gui
implementation from the app. Struts actions convert HttpRequest etc into
application centric command objects thus the app knows nothing about HTTP.
My struts actions call methods on an interface which uses the facade
pattern. Hence all the app's functions are encapsulated in this facade.
Hence I can create different facade implementations ie one based on EJB, one
based on DAO and these can be dynamically configured at runtime...

Hence Struts knows nothing of the backend (EJB,DAO etc) and the backend
knows nothing about the frontend!

regards

Rob

----- Original Message -----
From: "Adam Young" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, December 03, 2001 4:06 AM
Subject: EJB integrations


> My application has a tabbed list of forms.  Based on user permissions, I
> want to show a specific list of tabs.  The tabs are images, one for
> selected, one for non selected.
>
> Each tab relates to a JSP.  It also has two struts actions associated
> with it, one for load, one for submit.  Ideally, the logic used to do
> these two things would reside in EJBs, and communicate with Struts
> through relatively simple value objects.  As things evolve, however ,I
> find more and more logic in the Actions.
>
> Thus I am starting to think of a major refactoring with the following
> objects:
> I'll use a psedo code that should be understandable:
>
> ApplicationFeature {
>  tabUpImage;
>  tabDownImage;
>  permission;
>  formJsp; //I want this to be a JSP fragement so I get all of the
> benfits of the custom tags
>  templateJSP;  /*reposnible for getting and rendering the formJsp, etc.*/
>
> either{
>   strutsLoadAction;//what to call before the feature Page is displayed
>   strutsSubmitAction//what to call when the featurePage submit button is
> pressed
> }or{
>   EJBValueObject ejbLoadAction();//what to called before the feature
> Page is displayed
>   void ejbSubmitAction(EJBValueObject)//what to call when the
> featurePage submit button is pressed
> }
>
> }
>
> I don't want to parallel struts with an EJB framework that does the same
> thing.  I like compile time binding and want to stick with struts being
> the most fluid/loosely typed portion of the code.
>
> How have other people standardized the connection between struts and
> EJBs?  Would It be desireable to make struts EJB aware, so that instead
> of creating a simple java object, it creates a reference to an EJB?
>  What would you do about the getting values out of the HttpRequest and
> response objects, such as attributes.  I suppose you could make some
> sort of optional pre and post processor. but that could really
> complicate the logic.
>
> If this is something that has been beaten to death already or has been
> solved in some portion of the Struts tree, please point me to it
> politely, and I will rebury my head in the sand.
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to