Sat Mar 25 14:40:13 EDT 2017
When to use OO?
OO is needed when a concept in your program has identity, existence
over time, state. All those are maybe rooted in how we thing about
Anything that doesn't change over time, is not an object. Often it is
simpler to think in terms of data (a transition of an object is
actually two different data items).
In my work, I encounter objects as hardware: physical things that have
state that you cannot represent as explicit data. Programs that deal
with these things are centered around COMMUNICATION.
Almost everything else is data PROCESSING, which is better expressed
as functional programs.
An architecture is often a combination of these two.
These two views are dual (actions and the things acted upon). Which
side to view it as is most of the time dictated by the physical
Also, these can be layered:
- functions can have (hidden, short-lived) objects in their
- objects can have functions implementing their state transitions