O'Reilly Head First Design Patterns 978-0-596-00712-6 Leaflet

Product codes
978-0-596-00712-6
Page of 2
intro 
to 
Design Patterns
you are here 4
35
Sharpen your pencil
   
A.  Code is duplicated across subclasses.
   
B.  Runtime behavior changes are difficult.
   
C.  We can’t make duck’s dance.
   
C.  Hard to gain knowledge of  all duck behaviors.
   
D.  Ducks can’t fly and quack at the same time.
   
E.  Changes can unintentionally affect other ducks.
Which of  the following are disadvantages of  using subclassing to provide specific 
Duck behavior?  (Choose all that apply.)
Solutions
Sharpen your pencil
What are some factors that drive change in your applications? You might 
have a very different list, but here’s a few of  ours. Look familiar?
My customers or users decide they want something else, or they want new functionality.
My company decided it is going with another database vendor and it is also purchasing its data 
from another supplier that uses a different data format. Argh!
Well, technology changes and we’ve got to update our code to make use of protocols.
We’ve learned enough building our system that we’d like to go back and do things a little better.
� �
� � �
� �
� �
� � � �
� � �
� �
��
��
��
��
��
� � � � �
� �
��
� � � � �
� � �
��
� �
��
� � � � �
��
� � �
������
�����������������������������������������
��������������������������������������
�� ������� ���� ������ �������������
����������������������������������������
������������
������������������������������������������������
��������������������������������������
������������
���������������������������������
����������������������������������
��� �������� ���� �� ���� ������������ �������
����
�� ���� ����� ��������� ������������
��������������������������������������
������������
�� ���� ��� ����������� ����� ������
������������������������������������������
�����������
�� ����� ���� ����������� �������������
��������������������������������������
���������������������������������������������������
������������������������������������������
�����������������������������������������