Download presentation
Presentation is loading. Please wait.
Published byBeatrice Richardson Modified over 9 years ago
1
Decorator Pattern Lecture Oo29 Artificial Life Simulation
2
Teaching Points n Decorator Pattern n Artificial Life Simulation –Lab 3
3
Review n What is a component n How can you use components and interfaces to efficiently partition your system’s physical architecture? n In Java-style exception handling what is “thrown?”
4
Decorator Pattern n The Problem –sometimes we want to add responsibilities to individual objects, not to an entire class. –for responsibilities that can be add/withdrawn dynamically –when extension by subclassing is impractical
5
Decorator Pattern n The solution –Attach additional responsibilities to an object dynamically. –A flexible approach is to enclose the component in another object that adds the responsibility.
6
Decorator Pattern (structure)
7
Decorator Pattern (example)
8
Artificial Life Simulator n A framework n Pattern based –Decorator –Chain of responsibility –Observer –Iterator
9
Use Case Diagram
10
Architecture
12
Run Simulation Use Case
13
Update Creature State Use Case –Interaction with the world
14
Update Creature State Use Case n Reproduction
15
Teaching Points n Decorator Pattern n Artificial Life Simulation –Lab 3
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.