Which design pattern does the following description best match?
"One of the main drivers for this pattern is to minimize network traffic. It does this by providing a local representation of a remote object. This pattern is associated with the idea of a cache, i.e. an area where frequently accessed data can be stored for rapid access."
A. Transfer Object
B. Model-View-Controller
C. Business Delegate
D. Service Locator
That is from examulator/ ► SCWCD/ ► Quizzes/ ► Design Patterns Quiz/ ► Attempt 1, http://www.examulator.com/moodle/mod/quiz
SCJP 1.4 SCJD
Frank Bennett wrote:
The question is confusing and a more appropriate answer would be C. Business Delegate.
Coarse-grained methods of a Business Delegate can also reduce or minimize network traffic. However, a Business Delegate may or may not represent a server-side (remote) object.
It does this by providing a local representation of a remote object.
This pattern is associated with the idea of a cache, i.e. an area where frequently accessed data can be stored for rapid access."
SCJP 5.0 SCWCD 5.0
It does this by providing a local representation of a remote object.
Prateek Parekh wrote:
It does this by providing a local representation of a remote object.
This is all you need in the question to determine that its a Transfer Object.
SCJP 5.0 SCWCD 5.0
... is to somehow think exactly like the person that created the exam or the author of the question. And this vaguely has very little to do with understanding software design patterns. There are too many variations and strategies ...
A Business Delegate is mainly used to hide the complexity of remote communications to clients. I don't think that this can be the answer. The explanation clearly matches answer A.
the presentation-tier components are vulnerable to changes in the implementation of the business services:
Study, 'Peabody' notes on design patterns. This will clear many confusions.
Service locator provides the facility of caching.
The question is quite confusing as no pattern ( transfer Object or Service locator) satisfies both the condition completely .
But i think the answer should be Service locator as it is associated with catching and question is dealing with only representation not a true copy of the object.
It does this by providing a local representation of a remote object. This pattern is associated with the idea of a cache, i.e. an area where frequently accessed data can be stored for rapid access."
A Transfer Object is for transferring data between server-side and client-side code. It may or may not represent a server-side object (remote object). It may simply be used for moving data. The concept of a "cache" is not asscociated with using transfer objects either, in my experience.
The question is confusing and a more appropriate answer would be C. Business Delegate.
Coarse-grained methods of a Business Delegate can also reduce or minimize network traffic. However, a Business Delegate may or may not represent a server-side (remote) object.
SCJP 5.0 SCWCD 5.0
Petar Tomičić wrote:I apologize.
SCJP 5.0 SCWCD 5.0
but what about caching??? Transfer object is not associated with caching.
SUN Core J2EE Patterns
Transfer Object: Reduces Network Traffic
A Transfer Object transfers the values from the entity bean to the client in one remote method call. The Transfer Object acts as a data carrier and reduces the number of remote network method calls required to obtain the attribute values from the entity beans. The reduced chattiness of the application results in better network performance.
Always look on the bright side of life. At least this ad is really tiny:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|