File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes Business Delegate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Business Delegate" Watch "Business Delegate" New topic
Author

Business Delegate

Udaya Bascar
Ranch Hand

Joined: Jun 18, 2002
Posts: 32
hi
in business delegate pattern if i am asked to explain
for what purpose JSP's are used and
Servlets are used? what i have to say?
can some one explain the basics of BusinessDelegate Pattern?
when we will choose this pattern?
working of an sample EJB how its invoked and how the results are transferred to HTML in Business Delegate explain?
thanx
Regards
bascar
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
The main point of business delegate is to hide some implementation details from the client. Say I have an EJB service on my server and you'd like to use it from your server. You ask me "What do I have to do to use it?" I tell you all about EJB remote, initial context, home finders, proxies and all those details. Oh, and I'm thinking about changing my service to SOAP and then you'll have to learn XML and HTTP and SOAP and a bunch more stuff. You make this face:
After a few of these encounters, I build a business delegate that does all the EJB remote stuff. Now when you ask how to use my service, I say "Use this delegate. Just call a method." You make this face: And if I change from EJB to SOAP I give you a new business delegate with exactly the same interface and it doesn't bother you one bit.
As another bonus, I might do some performance optimization in my delegate, like caching common requests.
I don't see this relating directly to HTML. If your server happens to be a web server, you'd generate HTML using the data you got from my delegate just as you always would, maybe JSPs.
Hope that made sense!


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Udaya Bascar
Ranch Hand

Joined: Jun 18, 2002
Posts: 32
hi Stan
Thanx very much for the info
do u have any sample code that implements BusinessDelegate Pattern
with respect to an project in EJB
can u send me the code how business delegate is used to look up the
business services
waiting for ur reply
Thanx n advance
bye
baskar
Udaya Bascar
Ranch Hand

Joined: Jun 18, 2002
Posts: 32
i am going to use weblogic6.1 as my appserver
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
http://www.google.de/search?q=business+delegate+example


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
there are ample examples for the J2EE patterns in Deepak Alur's book "J2EE Design Patterns". It will be useful for your pursuits.
Dan.


Kishore
SCJP, blog
Mark Lybarger
Ranch Hand

Joined: Dec 19, 2003
Posts: 72
another value i've heard mentioned to the business delegate pattern is that you gain better object orientedness. the comment was that it's hard if not downright impossible to do base/sub classing in ejb's ) VehicleBean -> CarBean -> MotorcycleBean, etc).
though this has nothing much to do with servlets/jsp's. those are merely one possible client to this business delegate.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Business Delegate