[.] DejaVU Online: -- The OO Lectures
[.] - [up] [top] - [I] [II] [III] [IV] - [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] - [A] [R]

Behavioral Patterns


Behavioral Patterns

communication

deal with algorithms and the assignment of responsibilities between objects

class

object

composition


slide: Behavioral Patterns


Encapsulating behavior

objectify!

  • Strategy -- algorithm
  • Command -- request
  • State -- object state -> behavioral change
  • Visitor -- to extract behavior from class
  • Iterator -- access and traversal

slide: Encapsulating behavior


Observer

one-to-many dependencies and notification

Structure

Consequences

  • abstract coupling between subject and observer
  • support for broadcast
  • deals with unexpected updates

Implementation

  • mapping subjects to observers
  • observing more than one subject?
  • who triggers the update - subject or client of subject
  • dangling references to subject
  • consistency of subject (before notification)
  • adding observer-specific update protocols (push / pull)
  • specifying modifications of interest (aspects)
  • how to encapsulate update semantics

slide: Observer Pattern


[.] - [up] [top] - [I] [II] [III] [IV] - [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] - [A] [R]
Hush Online Technology
hush@cs.vu.nl
02/15/00