a few design patterns

Post on 18-Nov-2014

604 Views

Category:

Documents

5 Downloads

Preview:

Click to see full reader

DESCRIPTION

A few design patterns that seem to crop up in small scientific programming tasks, for a non-programmer audience.

TRANSCRIPT

A Few Design PatternsStrategy, Template, Factory

StrategyLet client and algorithm change independently

StrategyLet client and algorithm change independently

Template MethodDefine algorithm skeleton, defer some steps to subclasses

Template MethodDefine algorithm skeleton, defer some steps to subclasses

run(data):format() -> commonrunFFT() -> templatedecode() -> common

Factory MethodDefine an interface to create different algorithmsSeparate object definition, creation and use.

top related