re: Practical Coding Patterns For Boss Developers #1: Special Case VIEW POST


Seems very similar, except the special case is usually used for replacing null values as a starting point.

When used to expose polymophic behaviors, the state pattern uses a "container" class to hold the state using composition, but the special case classes use sub-typing (thus the need for a factory of some kind).

code of conduct - report abuse