Name: ______________________________ Date:______________________________
Software Engineering Specialization
Exercises: Design Patterns
Exercise 1: Which of the following are disadvantages of using inheritance to provide Duck
behaviour (Choose all the apply.)?
☐ A. Code is duplicated across subclasses.
☐ B. Runtime behaviour changes are difficult.
☐ C. We can't make ducks dance.
☐ D. Hard to gain knowledge of all duck behaviours.
☐ E. Ducks can't fly and quack at the same time.
☐ F. Changes can unintentionally affect other ducks.
Exercise 2: How does the observer pattern use the following principles?
Design Principle: Identify the aspects of your application that vary and separate them from what
stays the same.
Design Principle: Program to an interface, not an implementation.
Design Principle: Favour composition over inheritance.