You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by meena r <me...@yahoo.com> on 2004/10/20 19:33:04 UTC

Opinion needed on a Design issue

Hi,

We have been mulling over an issue where , we have
people on our team who are proposing to pass the
HttpSession which we have in our Action classes to the
buisness delegate(which is an ordinary java class
which encapusulates calls the session facade). While
the j2ee blueprint for the business delegate pattern
says that the delegate decouples client code from
buisness component usage and lookup, folks in the team
am working on believe that there is no strong reason
why the session should not be made available to the
delegate. Please pour forth any opinion as to whether
this is a wise thing to or not.

Thanks
Meena




		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

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


Re: Opinion needed on a Design issue

Posted by Sean Schofield <se...@gmail.com>.
The idea would be to use BusinessDelegate to decouple your business
logic from the web-tier.  Use your struts Actions to get stuff out the
request, session, etc.  Then pass plain old java objects (POJOs) to
the methods of your BusinessDelegate.

This way the business logic inside is not dependent on the fact that
the original information was supplied via the web.  You can easily
reuse it in a client-server application, etc.  Also, this makes the
BusinessDelegate much easier to do unit testing on (because you don't
need to simulate HTTP requests, etc.)

HTH,
sean


On Wed, 20 Oct 2004 11:23:17 -0700 (PDT), meena r <me...@yahoo.com> wrote:
> Is the Business Delegate a web-tier component? which
> helps in decoupliong the web -tier component from the
> business tier component or is it a business tier
> component?
> 
> 
> 
> 
> --- Craig McClanahan <cr...@gmail.com> wrote:
> 
> > What he (Matt) said.
> >
> > If you are going to tie your Business Delegate class
> > to web tier APIs,
> > there is not really much point in having them at all
> > -- you could just
> > do your business logic in the Action.execute()
> > method directly and
> > save having to maintain two classes.  (That's a
> > sub-optimal idea as
> > well, but if you're going to follow this path you
> > might as well do
> > less work.)
> >
> > Craig McClanahan
> >
> >
> > On Wed, 20 Oct 2004 13:36:36 -0400, Matt Hughes
> > <mh...@feith.com> wrote:
> > > It's a bad idea because what if in the future you
> > want to use that
> > > business logic elsewhere?  What if you want to use
> > it in a webservice or
> > > in a GUI standalone application.  The business
> > logic should have to know
> > > nothing about web servers and HttpSession objects,
> > unless your business
> > > is building web servers.
> > >
> > >
> > >
> > > meena r wrote:
> > >
> > > >Hi,
> > > >
> > > >We have been mulling over an issue where , we
> > have
> > > >people on our team who are proposing to pass the
> > > >HttpSession which we have in our Action classes
> > to the
> > > >buisness delegate(which is an ordinary java class
> > > >which encapusulates calls the session facade).
> > While
> > > >the j2ee blueprint for the business delegate
> > pattern
> > > >says that the delegate decouples client code from
> > > >buisness component usage and lookup, folks in the
> > team
> > > >am working on believe that there is no strong
> > reason
> > > >why the session should not be made available to
> > the
> > > >delegate. Please pour forth any opinion as to
> > whether
> > > >this is a wise thing to or not.
> > > >
> > > >Thanks
> > > >Meena
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >__________________________________
> > > >Do you Yahoo!?
> > > >Yahoo! Mail Address AutoComplete - You start. We
> > finish.
> > > >http://promotions.yahoo.com/new_mail
> > > >
> > >
> >
> >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > > >For additional commands, e-mail:
> > user-help@struts.apache.org
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > user-help@struts.apache.org
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> >
> >
> 
> _______________________________
> Do you Yahoo!?
> Declare Yourself - Register online to vote today!
> http://vote.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

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


Re: Opinion needed on a Design issue

Posted by Woodchuck <wo...@yahoo.com>.
i guess the extreme case would be that your entire web app having only
one Action class to handle every page.  and EVERYTHING will be in that
one big Action class... validation, business, logic, even persistence
functions!!  the whole web app in one class!!  only one class to
maintain!!  woohoo!!



--- Craig McClanahan <cr...@gmail.com> wrote:

> What he (Matt) said.
> 
> If you are going to tie your Business Delegate class to web tier
> APIs,
> there is not really much point in having them at all -- you could
> just
> do your business logic in the Action.execute() method directly and
> save having to maintain two classes.  (That's a sub-optimal idea as
> well, but if you're going to follow this path you might as well do
> less work.)
> 
> Craig McClanahan
> 
> 
> On Wed, 20 Oct 2004 13:36:36 -0400, Matt Hughes <mh...@feith.com>
> wrote:
> > It's a bad idea because what if in the future you want to use that
> > business logic elsewhere?  What if you want to use it in a
> webservice or
> > in a GUI standalone application.  The business logic should have to
> know
> > nothing about web servers and HttpSession objects, unless your
> business
> > is building web servers.
> > 
> > 
> > 
> > meena r wrote:
> > 
> > >Hi,
> > >
> > >We have been mulling over an issue where , we have
> > >people on our team who are proposing to pass the
> > >HttpSession which we have in our Action classes to the
> > >buisness delegate(which is an ordinary java class
> > >which encapusulates calls the session facade). While
> > >the j2ee blueprint for the business delegate pattern
> > >says that the delegate decouples client code from
> > >buisness component usage and lookup, folks in the team
> > >am working on believe that there is no strong reason
> > >why the session should not be made available to the
> > >delegate. Please pour forth any opinion as to whether
> > >this is a wise thing to or not.
> > >
> > >Thanks
> > >Meena
> > >
> > >
> > >
> > >
> > >
> > >__________________________________
> > >Do you Yahoo!?
> > >Yahoo! Mail Address AutoComplete - You start. We finish.
> > >http://promotions.yahoo.com/new_mail
> > >
> >
>
>---------------------------------------------------------------------
> > >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> > >
> > >
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> > 
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 



		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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


Re: Opinion needed on a Design issue

Posted by meena r <me...@yahoo.com>.
Is the Business Delegate a web-tier component? which
helps in decoupliong the web -tier component from the
business tier component or is it a business tier
component?




--- Craig McClanahan <cr...@gmail.com> wrote:

> What he (Matt) said.
> 
> If you are going to tie your Business Delegate class
> to web tier APIs,
> there is not really much point in having them at all
> -- you could just
> do your business logic in the Action.execute()
> method directly and
> save having to maintain two classes.  (That's a
> sub-optimal idea as
> well, but if you're going to follow this path you
> might as well do
> less work.)
> 
> Craig McClanahan
> 
> 
> On Wed, 20 Oct 2004 13:36:36 -0400, Matt Hughes
> <mh...@feith.com> wrote:
> > It's a bad idea because what if in the future you
> want to use that
> > business logic elsewhere?  What if you want to use
> it in a webservice or
> > in a GUI standalone application.  The business
> logic should have to know
> > nothing about web servers and HttpSession objects,
> unless your business
> > is building web servers.
> > 
> > 
> > 
> > meena r wrote:
> > 
> > >Hi,
> > >
> > >We have been mulling over an issue where , we
> have
> > >people on our team who are proposing to pass the
> > >HttpSession which we have in our Action classes
> to the
> > >buisness delegate(which is an ordinary java class
> > >which encapusulates calls the session facade).
> While
> > >the j2ee blueprint for the business delegate
> pattern
> > >says that the delegate decouples client code from
> > >buisness component usage and lookup, folks in the
> team
> > >am working on believe that there is no strong
> reason
> > >why the session should not be made available to
> the
> > >delegate. Please pour forth any opinion as to
> whether
> > >this is a wise thing to or not.
> > >
> > >Thanks
> > >Meena
> > >
> > >
> > >
> > >
> > >
> > >__________________________________
> > >Do you Yahoo!?
> > >Yahoo! Mail Address AutoComplete - You start. We
> finish.
> > >http://promotions.yahoo.com/new_mail
> > >
> >
>
>---------------------------------------------------------------------
> > >To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > >For additional commands, e-mail:
> user-help@struts.apache.org
> > >
> > >
> > >
> > >
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> > 
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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


Re: Opinion needed on a Design issue

Posted by Craig McClanahan <cr...@gmail.com>.
What he (Matt) said.

If you are going to tie your Business Delegate class to web tier APIs,
there is not really much point in having them at all -- you could just
do your business logic in the Action.execute() method directly and
save having to maintain two classes.  (That's a sub-optimal idea as
well, but if you're going to follow this path you might as well do
less work.)

Craig McClanahan


On Wed, 20 Oct 2004 13:36:36 -0400, Matt Hughes <mh...@feith.com> wrote:
> It's a bad idea because what if in the future you want to use that
> business logic elsewhere?  What if you want to use it in a webservice or
> in a GUI standalone application.  The business logic should have to know
> nothing about web servers and HttpSession objects, unless your business
> is building web servers.
> 
> 
> 
> meena r wrote:
> 
> >Hi,
> >
> >We have been mulling over an issue where , we have
> >people on our team who are proposing to pass the
> >HttpSession which we have in our Action classes to the
> >buisness delegate(which is an ordinary java class
> >which encapusulates calls the session facade). While
> >the j2ee blueprint for the business delegate pattern
> >says that the delegate decouples client code from
> >buisness component usage and lookup, folks in the team
> >am working on believe that there is no strong reason
> >why the session should not be made available to the
> >delegate. Please pour forth any opinion as to whether
> >this is a wise thing to or not.
> >
> >Thanks
> >Meena
> >
> >
> >
> >
> >
> >__________________________________
> >Do you Yahoo!?
> >Yahoo! Mail Address AutoComplete - You start. We finish.
> >http://promotions.yahoo.com/new_mail
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

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


Re: Opinion needed on a Design issue

Posted by meena r <me...@yahoo.com>.
I had already put this point across telling that the
business delegate should be designed to service any
kind of client.But we have a senior member on our team
who says that anyway beyond the business delegate the
session object is not passed on thereon further to the
ejb's etc, so it is a matter of just having to write
another business delegate to service another client .
While I too think this should not be done I have not
been able to put across an argument other than the one
which you have mentioned. 

Thanks
Meena


--- Matt Hughes <mh...@feith.com> wrote:

> It's a bad idea because what if in the future you
> want to use that 
> business logic elsewhere?  What if you want to use
> it in a webservice or 
> in a GUI standalone application.  The business logic
> should have to know 
> nothing about web servers and HttpSession objects,
> unless your business 
> is building web servers.
> 
> meena r wrote:
> 
> >Hi,
> >
> >We have been mulling over an issue where , we have
> >people on our team who are proposing to pass the
> >HttpSession which we have in our Action classes to
> the
> >buisness delegate(which is an ordinary java class
> >which encapusulates calls the session facade).
> While
> >the j2ee blueprint for the business delegate
> pattern
> >says that the delegate decouples client code from
> >buisness component usage and lookup, folks in the
> team
> >am working on believe that there is no strong
> reason
> >why the session should not be made available to the
> >delegate. Please pour forth any opinion as to
> whether
> >this is a wise thing to or not.
> >
> >Thanks
> >Meena
> >
> >
> >
> >
> >		
> >__________________________________
> >Do you Yahoo!?
> >Yahoo! Mail Address AutoComplete - You start. We
> finish.
> >http://promotions.yahoo.com/new_mail 
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> >For additional commands, e-mail:
> user-help@struts.apache.org
> >
> >
> >  
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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


Re: Opinion needed on a Design issue

Posted by Matt Hughes <mh...@feith.com>.
It's a bad idea because what if in the future you want to use that 
business logic elsewhere?  What if you want to use it in a webservice or 
in a GUI standalone application.  The business logic should have to know 
nothing about web servers and HttpSession objects, unless your business 
is building web servers.

meena r wrote:

>Hi,
>
>We have been mulling over an issue where , we have
>people on our team who are proposing to pass the
>HttpSession which we have in our Action classes to the
>buisness delegate(which is an ordinary java class
>which encapusulates calls the session facade). While
>the j2ee blueprint for the business delegate pattern
>says that the delegate decouples client code from
>buisness component usage and lookup, folks in the team
>am working on believe that there is no strong reason
>why the session should not be made available to the
>delegate. Please pour forth any opinion as to whether
>this is a wise thing to or not.
>
>Thanks
>Meena
>
>
>
>
>		
>__________________________________
>Do you Yahoo!?
>Yahoo! Mail Address AutoComplete - You start. We finish.
>http://promotions.yahoo.com/new_mail 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>


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