loading...

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

TOP OF THREAD FULL DISCUSSION
re: This feels a lot like the state pattern to me. How is it different?
 

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