Design patterns implementation examples

Active Object

Definition:

Decouples method execution from method invocation.


Example:

I want to run some very complicated and time consuming task. I don’t need to spend time waiting for result. I do my work and when result is available I just grab it.


C++ code:

/src/activeobject.cpp
Download source code

UML class diagram:
Composite UML class diagram

UML sequence diagram:
Composite UML sequence diagram