Decorator Pattern - PowerPoint PPT Presentation

About This Presentation
Title:

Decorator Pattern

Description:

Decorator Pattern. The solution. Attach additional responsibilities to ... Decorator Pattern (structure) Decorator Pattern (example) Artificial Life Simulator ... – PowerPoint PPT presentation

Number of Views:188
Avg rating:3.0/5.0
Slides: 16
Provided by: Elec158
Category:

less

Transcript and Presenter's Notes

Title: Decorator Pattern


1
Decorator Pattern
  • Lecture Oo29
  • Artificial Life Simulation

2
Teaching Points
  • Decorator Pattern
  • Artificial Life Simulation
  • Lab 3

3
Review
  • What is a component
  • How can you use components and interfaces to
    efficiently partition your systems physical
    architecture?
  • In Java-style exception handling what is thrown?

4
Decorator Pattern
  • 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
  • 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
  • A framework
  • Pattern based
  • Decorator
  • Chain of responsibility
  • Observer
  • Iterator

9
Use Case Diagram
10
Architecture
11
(No Transcript)
12
Run Simulation Use Case
13
Update Creature State Use Case
  • Interaction with the world

14
Update Creature State Use Case
  • Reproduction

15
Teaching Points
  • Decorator Pattern
  • Artificial Life Simulation
  • Lab 3
Write a Comment
User Comments (0)
About PowerShow.com