Software Carpentry
More on Objects


Introduction


You Can Skip This Lecture If...


Length


Overloading Operators


Commutativity


Other Special Methods


Example: Sparse Vector


How Long is a Sparse Vector?


Vector Behavior


Dot Product


Addition


Testing


Static Data Members


Static Methods


Design Patterns


The Singleton Pattern


Singleton Implementation


Demonstration


The Visitor Pattern


Visitor Implementation


Demonstration


The Abstract Factory Pattern


Abstract Factory Builder


Abstract Factory Manager


Demonstration


The Command Pattern


Base Command Class


A Particular Command


Demonstration


A Few Others


Summary