Professional Documents
Culture Documents
homework
Problems:
- type check
- polymorphic behavior displayed as alt
Problems if violated:
method calls running to the same lifeline cannot be separated
for different objects
behavior is ill-defined
Rules:
model different objects of the same type with different lifelines
use different names for them
Pacman Monster
Problem:
calling a method inaccessible through
the known static type
Problems if violated:
the sequence cannot be implemented
downcast results in a violation of LSP and OCP
Rules:
make sure the method called is available through the known
static type of the server
Pacman Monster
Field f2 delegates the call: Pacman does not know the Pellet directly