题目内容

Which of the following would be reasonable uses of the Composite pattern in RottenPotatoes?a. Movies can be organized into Playlistsb. Moviegoers can be organized into groups

A. a. only
B. b. only
C. Both a. and b.
D. Neither a. nor b.

查看答案
更多问题

Which design pattern is used to invalidate a cached page after the underlying data has changed?

Adapter
B. Decorator
C. Strategy Observer
D. Observer

What technique allows fragment caching to prevent ActiveRecord from ever contacting the database even after an ActiveRecord query is made (such as Movie.all)?

A. Cache invalidation
B. Lazy evaluation
C. A content delivery network
D. Lambda calculus

You have just implemented several levels of caching in your web application. A user calls to tell you that when they visit the site, they see another user's name as the currently logged in user. Assuming that nobody else has used the user's computer, This problem could stem from a stale (select all that apply):

A. Browser cache
B. Page cache
C. Action cache
D. Query cache

Suppose Order belongs to Customer, and a view has @order.customer.name. Is this a Demeter violation?

A. Yes...but probably reasonable to just expose object graph in the view in this case
B. Yes...replace with Order#customer_name which delegates to Customer#name
C. Yes...you can make a case for either of the above
D. No...by using belongs_to we're already exposing info about the Customer anyway

答案查题题库