Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Behavioral Patterns
Momento
Mediator
Behavioral pattern
2
Behavioral Patterns
3
Chain of Responsibility:
Request delegated to the responsible service provider
Command:
Request or Action is first-class object, hence re-storable
Iterator:
Aggregate and access elements sequentially
Interpreter:
Language interpreter for a small grammar
Mediator:
Coordinates interactions between its associates
Memento:
Snapshot captures and restores object states privately
Observer:
Dependents update automatically when subject
changes
State:
Object whose behavior depends on its state
Strategy:
Abstraction for selecting one of many algorithms
Template Method:
Algorithm with some steps supplied by a derived class
Visitor:
Operations applied to elements of a heterogeneous
object structure
Memento Pattern
Memento pattern
6
Intent
7
Problem
8
Discussion
9
10
Structure
11
Implementation
12
Consequences
13
Example
14
Sample Co
de
15
Memento (Software
counterpart)
16
Mediator Pattern
Mediator pattern
17
Intent
18
Participants
20
Colleague classes
Applicability
21
22
Consequences Advantages
Comprehension - The mediator encapsulate the logic of
23
Consequences Disadvantages
Complexity
24
Example 1
25
Example 2
26
Example
27
Sample Co
de
28
Mediator (Software
counterpart)
Gtalk
Server