Friday, April 29, 2011

Self Test: Chapters 51 to 58

Questions

Question 1

Which design pattern has as its primary responsibility to decouple presentation and service tiers, and a central director?
A. Value Object
B. Composite View
C. Business Delegate
D. Model-View-Controller

Question 2

Which design pattern has as its primary responsibility to exchange data between tiers?
A. Value Object
B. Composite View
C. Business Delegate
D. Model-View-Controller

Question 3

Which design pattern has as its primary responsibility to abstract data sources and provide transparent access to the data in these sources?
A. Value Object
B. Data Access Object
C. Business Delegate
D. Model-View-Controller
E. None of the above

Question 4

Which design pattern has as its primary responsibility to isolate the presentation and the business tiers from each other by adding a director between the two, making it is easier to manage changes on either side?
A. Session Facade
B. Data Access Object
C. Business Delegate
D. Model-View-Controller
E. Aggregate Entity

Question 5

Which one of the following is most likely used for cache?
A. Value Object
B. Data Access Object
C. Business Delegate
D. Cache Object
E. Aggregate Entity

Question 6

Which design pattern acts as a switchboard, dispatching incoming requests to the correct resource?
A. Value Object
B. Data Access Object
C. Business Delegate
D. Front Controller

Question 7

Which design pattern is most likely to care about RDBMS, OODBMS, and flat files?
A. Value Object
B. Data Access Object
C. Business Delegate
D. Cache Object
E. Aggregate Entity

Question 8

Which design pattern does the following force most affect?
Persistent storage APIs vary between vendors, which causes a lack of uniform APIs to address the requirements for accessing storages.
A. Value Object
B. Data Access Object
C. Business Delegate
D. Cache Object
E. Aggregate Entity

Question 9

Which design pattern has as its primary role to provide control and protection for the business service?
A. Value Object
B. Data Access Object
C. Business Delegate
D. Cache Object
E. Aggregate Entity

Question 10

Which design pattern is most likely to be used as a proxy?
A. Business Delegate
B. Data Access Object
C. Model-View-Controller
D. Value Object

Question 11

Which design pattern reduces the number of remote network method calls required to obtain the attribute values from the entity beans?
A. Business Delegate
B. Data Access Object
C. Model-View-Controller
D. Value Object

Question 12

Which design pattern that usually is a good candidate to work with entity beans becomes less useful when a cache is used to persist data?
A. Business Delegate
B. Data Access Object
C. Model-View-Controller
D. Value Object

Answers

Question 1

D. The Model-View-Controller pattern has as its primary responsibility to decouple presentation and data/business logic tiers, by using a director or switchboard between them.

Question 2

A. The Value Object pattern has as its primary responsibility to exchange data between tiers. Although the Business Delegate and Model-View-Controller also do this, it isn't their primary responsibility.

Question 3

B. The Data Access Object pattern has as its primary responsibility to abstract data sources and provide transparent access to the data in these sources. The Business Delegate and Model-View-Controller may do so, but the Data Access Object always does this.

Question 4

D. The Model-View-Controller pattern has as its primary responsibility to minimize the impact of changing the client or business tier. Remember that this is a very high-level pattern, so it often uses other patterns.

Question 5

A. The Value Object pattern is most likely used for cache. Notice that its whole purpose is to collect data from somewhere far and bring it close in a neat package. The Data Access Object and Business Delegate often actually use a Value Object underneath. The Cache Object is fiction and the Aggregate Entity is not one of the four that you might see on the exam.

Question 6

D. The front controller pattern acts as a switch board, dispatching incoming requests to the correct resource.

Question 7

B. The Data Access Object design pattern is one that deals with RDBMS, OODBMS, excel, flat files, and more. This is pattern you use to isolate the access API from the actual data repository implementation. Value Object and Business Delegate don't do this. The other two patterns mentioned are distracters.

Question 8

B. The Data Access Object design pattern is affected most by varying persistent storage APIs due to different vendors and non-uniform APIs to address the requirements to access storages. Whenever you see the word persistent, think Data Access Object design pattern.

Question 9

C. The Business Delegate design pattern has as its primary role to provide control and protection for the business service. Although you can't just ignore the rest of the Question, normally when a Question focuses on the business service, think Business Delegate design pattern.

Question 10

A. The Business Delegate design pattern is most likely to be used as a proxy. Its whole purpose is being the mediator between a business service and the rest of the world, especially, but not limited to, clients. This is what proxies do, too.

Question 11

D. The Value Object design pattern reduces the number of remote network method calls required to obtain the attribute values from the entity beans. Although the four patterns in the answers do this, it's the main reason for using a Value Object.

Question 12

B. The Data Access Object design pattern is usually a good candidate to work with data that is remote or and costly to query often, but becomes a bad choice with container-managed persistence. This is tricky because the container often, but not always, will persist data as a primary function.

Previous Chapter: Quick Recap - Chapters 51 to 58

Next Chapter: Chapter 59 - Exam Preparation Tips

No comments:

Post a Comment

© 2013 by www.inheritingjava.blogspot.com. All rights reserved. No part of this blog or its contents may be reproduced or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without prior written permission of the Author.

ShareThis

Google+ Followers

Followers