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
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
Joined: Jun 18, 2002
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
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
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.