File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Value Object & Facade Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Value Object & Facade" Watch "Value Object & Facade" New topic

Value Object & Facade

R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5382
here is que from Podar
Question 51
___________ pattern enables improved network traffic and response time. Fewer remote calls are made and less data is passed back and forth
A Value Objects
B Data Access Objects
C Fa´┐Żade
D Business Delegate
Ans is Value object.
But I think Value object does not transmit less data as data is simply put together in a Value object.
I think answer is Facade as it reduces n/w traffic and also there is less data transer over network as workflow is taken care at server.
Correct me if I am wrong ..

"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164

this question has a strong ejb background. Every method call to an ejb, be it an entity bean or an session bean produces overhead (more a strong feeling than actual knowledge). If it is actually network overhead, well thats a different question.
If you have a session bean as a facade which calls various getter/setters of an entity bean. In EJB1.1 you use RMI-IIOP semantics for communication, even if both the session bean and the entity bean are co-located in the same JVM. The server dosen't necesarily use RMI-IIOP to realize that calls for performance reasons. In EJB2.0 there are special local component interfaces, which make this optimization option part of the specification.
So there is not necesarily network overhead. But I strongly believe that every entity bean call contrives s.o.m.e overhead. So its better to collect all values you want to retrieve from the entity bean in o.n.e value object and return it to the session bean which returns it to the client/servlet.
Any more comments? I think I am missing some important informations.
IBM Certified Websphere Specialist (158)
like that: don't trust me, find the truth
I agree. Here's the link:
subject: Value Object & Facade
jQuery in Action, 3rd edition