CS 151 Day 11

Cover page image

Cay S. Horstmann

Day 11 Clicker Question 1

Adding a border to a Swing component is an example of which design pattern?

  1. DECORATOR
  2. STRATEGY
  3. COMPOSITE
  4. None of the above

Day 11 Clicker Question 2

In the sample program of Section 5.8, the Bundle class is an example of which design pattern?

  1. DECORATOR
  2. STRATEGY
  3. COMPOSITE
  4. None of the above

Day 11 Clicker Question 3

Not everything that is strategic is an instance of the STRATEGY pattern. Which conditions must be fulfilled? Check all that apply.

  1. Some method needs to carry a certain task as part of doing its job, but there is more than one way of doing that task.
  2. Clients who call the method want to control how that task is executed.
  3. An interface is provided with a method for carrying out the task.
  4. Clients supply an object whose class implements that interface when calling the method.

Lab

lab

Pattern Discussion

Which Pattern?

HTML Formatting

Composite Icons

Discussion

discussion