A class defines both state (properties) and behaviors (methods). You can change the state of an object by changing the value of a property. In most OO languages however, you cannot assign a different value to a method even when "properties" are implemented as accessors, which are methods. This article explores the history, and consequences of this perduring state/behavior distinction in some OO languages in light of others, most famously Javascript, which treats state and behavior equally.

© Lognosys LLC. All rights reserved.