题目内容

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

The use of FakeWeb to stub external SOA requests in testing is an example of which design pattern?- 未答复

A. Null object
B. Proxy
C. Adapter
D. Facade

n RSpec controller tests, it's common to stub ActiveRecord::Base.where, an inherited method. Which statements are true of such tests:a. The controller under test is tightly coupled to the modelb. In a static language, we'd have to use DI to achieve the same task in the testing framework.

A. only (a)
B. only (b)
C. both (a) and (b)
D. neither (a) nor (b)

答案查题题库