• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[mock][J2EE pattern][Business Delegate]

 
Sam Sun
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the benefits of using Business Delegate pattern?
select 3 choices

1. It shields the clients from the business rule changes.
2. It allows the clients to access the business services using any technology like EJB, CORBA, or RMI.
3. It shields the clients from changes in the implementation of business services.
4. It provides a uniform interface to the clients.
5. It improves performance by caching the data.

answer is 3,4,5
But I am not sure why 1 isn't correct.
Business rule isn't business service?
What I understand is that "business rule" is "business logic (controller)" in presentation tier, but business service is in business tier.

Please update me. Thanks.
 
Radmika Arunachalam
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, why answer 2 is wrong? Business Delegate Pattern will hide the client from details about technology like EJB, CORBA, or RMI and handle itself.. Is it not correct?
 
shiva viswanathan
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey by the way why is choice 5 correct .
Isnt the caching of data , the job of the Service Locator Pattern


According to me , the ans are 1,3,5
2 is again doubtful since it is more a function of the service locator

Any other answers


Catch You Later
Shiva
 
Kedar Dravid
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From SCWCD Exam Study kit:

1) Business Delegate: It acts as a representative of the client components (JSP pages and servlets in the presentation tier which delegate the work of invoking the business service API methods to the Business Delegate objects). It knows how to look up and access the business services. If the API of the business service component changes, only the Business Delegate needs to be modified, without affecting the client components.

2) Business Service:
A business service component implements the actual business logic.
Examples: stateless session EJB, entity EJB, a CORBA object.

If you consider the second point above, I think answer 2 is probably wrong.
The option probably would have been correct if it were rephrased as:
It allows the clients to access the business services which have been developed using any technology like EJB, CORBA, or RMI.
But then, this exam is known to have some tricky questions, and rephrasing is not really an option.



IMO, answer 1 is probably correct as well.

One more question (not covered by the SCWCD exam, just curious):
Can an EJB object stub be considered as an example of a business delegate?

What say, folks?
[ July 09, 2005: Message edited by: Kedar Dravid ]
 
Sam Sun
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are the explanation in the Mock Exam:

What are the benefits of using Business Delegate pattern?
select 3 choices: answer is 3,4,5

1. It shields the clients from the business rule changes.
E: Clients normally work according to the business rule. A change in them will affect the whole system.
2. It allows the clients to access the business services using any technology like EJB, CORBA, or RMI.
E: The delegate and the client have to know what tech they'll use to communicate. A change in this will affect both.
3. It shields the clients from changes in the implementation of business services.
4. It provides a uniform interface to the clients.
5. It improves performance by caching the data.
E: Depending on business logic, the delegate object may even cache the results of stored procedure etc.

What I think:
1 wrong: Maybe business rule doesn't mean Business API.
2 wrong: Maybe it's wrong at word "any".
 
Sushma Sharma
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per my understanding, A Business Rule is a rule which is followed by the whole application or system.
Suppose, at present the business requires only 5 fields to do its decision making, but who can tell if they will need another 2 fields to make their decision. So even clients will be affected by this change...
so answer 1 is incorrect....
 
sergio mendez-rueda
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
after A. turing: if 3. It shields the clients from changes in the implementation of business services. is right, then 1. can not be wrog
 
Sam Sun
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sergio mendez-rueda:
Hi,
after A. turing: if 3. It shields the clients from changes in the implementation of business services. is right, then 1. can not be wrog


Sushma has explained it very well. The difference between 1 and 3 is the difference between "business rule" and "business service".
 
Stein Vom
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I couldn't understand that very well. Sushma, can you tell me which book you're referring for this. . .
 
David Bridgewater
author
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hallo all,

Well I'll stick my neck out and say that I think the question answer is right - but it all comes down to beastly semantics (that's the beauty of design patterns).

Here's why I think so. Business Delegate is all about shielding the presentation layer from the technical details of calling business APIs.

Answer 1 talks about "business rule" changes. Business rule to me says to me application logic. So no, Business Delegate will not protect you from an application logic change. If you were just altering the way the application logic was implemented, but not the application logic itself, Business Delegate could help; here it can't.

Answer 2 is not a stated benefit of the Business Delegate pattern. Whatever underlying technology you use is irrelevant. The point of the pattern is to place a layer between the underlying technology (whatever it is) and the client, so the client is unaware of what technology is being used. So the statement is (at best) misleading or false when applied to this pattern - you can safely say this is a wrong answer.

Answer 3 is absolutely a stated benefit of Business Delegate. You can change the implementation of a business service (e.g. do your switch from RMI to EJB) without affecting the client. I do agree that a lot hangs on your interpretation of "implementation of a business service". If you decide that means "a change to application logic", then you're back with the previous answers to the thread. However, I would (especially in the context of choosing the three most likely answers) go with "implementation of a business service" as meaning the technology implementation.

Answer 4: uniform interface to clients. Yes, true (though maybe "non-volatile" or "less technical" would be a better way of putting it). But if some business APIs in an application used direct JDBC access, and others EJBs, then a benefit of Business Delegate would be to provide similar ways of calling the APIs (whatever the underlying technology) - i.e. a "uniform" method of access.

Answer 5: yes, Business Delegate does have the potential to cache business data (as correctly noted previously, Service Locator also caches - but is meant to cache JNDI references only; you use Business Delegate to cache business objects if you choose. At least, that's my reading of the J2EE Patterns book!).

Hope this helps (or fans the flames in a constructive way...)

Best,

David.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic