Which pattern(s) help to hide the structure of a container from clients:(i) Visitor Pattern(ii) Observer Pattern(iii) Iterator Pattern(iv) Strategy Pattern
A. iii
B. i and iii
C. ii and iii
D. iii and iv
查看答案
Suppose we have setup the foreign key movie_id in reviews table. If we then add has_many :reviews to Movie, but forget to put belongs_to :movie in Review, what happens?
A. We can say movie.reviews, but review.movie won't work
B. We will get a database error when trying to save a Review
C. We will have no way of determining which movie a given review is associated with
D. All of the above
A likely violation of the Single Responsibility principle:Which class?
A. Veem
B. Blurk
C. SnitVeem
D. BlortVeem
E. JitVeem
F. No Violation
Which Ruby language mechanisms would be appropriate for implementing associations that can be used by ActiveRecord models? (a) build behaviors into ActiveRecord::Base (b) put behaviors in their own Module (c) put behaviors in their own Class
A. Only (a)
B. (a) or (b), but not (c)
C. (a) or (c), but not (b)
D. Any of (a), (b) or (c) would be equally suitable
A likely violation of the Single Responsibility principle:Which method?
A. zike
B. initialize
C. get_veem
D. wurgle
E. No Violation
F. the class as a whole