This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Questions: The need of Business Delegate?

Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reading the �Core J2EE Patterns � Best Practices and Design Strategies�, I don�t find it convincing enough to use Business Delegate.
The relationship between a business delegate and a business service is 1-1. A business delegate is on the presentation tier, and a business service is on the business tier.
In my opinion: If we implement a business service as an EJB, the business service has a stub on the presentation tier, which KINDA works a business delegate. I don�t find it convincing enough to use business delegates although I can find some minor reasons to use it.
Why Business Delegate:
1. Business delegate translates business tier exceptions into more presentation friendly exceptions.
Why Not Business Delegate:
1. The service look up code is always on the presentation tier no matter we place the service look up code in either a Servlet or a business delegate. Why bother to create an extra business delegate?
2. According to the book, business delegate is supposed to hide underlying implementation detail of business service from the presentation tier. In my opinion: with a business service as an EJB, the Remote Interface of the business service only exposes the business methods to the presentation tier. Since an EJB can achieve the same result, why do we need business delegate?
�Clients may need to implement caching mechanisms for business service information� (Page 248). Would anyone give me some explanations?
Thanks much in advance. I know you folks are the best. :-)
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi John,
I was not reading about the new Business Service pattern, however, as far as you justify your point of view, I think it would be no problem in the exam.
I also found BD very useful. It creates a layer between client and business, so that, clients don't know at all if the business methods are located remotely or locally. Note that one of the problems is with RemoteException (that I suppose you also have to deal with, in the interface defined by the Business Service pattern). If you don't implement BD, clients must be aware of RemoteException, so you lock clients with a REMOTE business implementation. If you decide latter not to use EJB, because you don't want to spend money/resources in a application server or whatever, you have to change client code. This would be simplified if you have the business access encapsulated in just one place - Business Delegate.

Dani Mazzuca
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Business Delegate takes care of how to delegate the reuqest to the next tier/system. So the Business Delegate will have logic to itegrate with another tier, all the implementation would go into one business delegate. All the Business delegate methods will be called from withing the tier. If ther is any change between those, it will be done in business delegate only, not all the individual calls. Look at petstore, try to understand how it is being applied.
    Bookmark Topic Watch Topic
  • New Topic