ITK/Design Principles

From KitwarePublic
< ITK
Revision as of 01:26, 11 February 2012 by Daviddoria (talk | contribs) (moved ITK Design Principles to ITK/Design Principles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This page contains the software design principles adopted in the Insight Toolkit (ITK)

Object Oriented

Modes vs Objects

Modes here refer to the option of enabling alternative behaviors in a class by introducing flags (booleans or enums) that switch the class behavior at run time.

Objects here refer to the option of implementing alternative behaviors by introducing a family of classes where each class implement one and only one specific behavior.

Guideline: Modes should be preferred over Objects when it is anticipated that a common use case, is to change those behaviors at run time during the use of an application.

Objects should be preferred over Modes when it is anticipated that the choices will be made at compilation time and that rarely need to be changed at run time.