0% found this document useful (0 votes)
4 views1 page

L17Exercise DesignPatternsWorkSheet

Uploaded by

hamzabjibji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

L17Exercise DesignPatternsWorkSheet

Uploaded by

hamzabjibji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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.

You might also like