An object in a program frequently has an internal "state", and the behavior of the object needs to change when its state changes. As someone who tends to think of objects as "data structures on steroids", it came as quite a shock when Netscape's Steve Abell pointed out that an object need not contain any values at all -- it can exist merely to provide behaviors, in the form of methods. This recipe demonstrates a networkcard that depends on its internal state connected/disconnected - to send/receive data.
NEW
Fixed some bugs.
How to implement state-dependent behaviorInformation