Alan Kay said “OO” was about messaging, not objects and drew a parallel to biological cells.
His views are enticing, but vague. The way I understand it is something like a Cellular Automata.
In a Cellular Automata there’s a grid of cells that can be in a variety of states. Then an update event is sent to all the cells. In response, the cells update their state based on their own state and the state of their neighbors.
So if we assume…
Grid => Software System
Cell => Object
Update Rule => Event/Message
Then we have a starting point. Locality differs (unless we define neighbors as objects that are connected), and there isn’t one update rule, but a variety of messages/events that objects can respond to.
Having used cellular automata, I’m aware of their power and the awesome global emergence that arises from local interactions. Thinking of this applied to the sphere of objects is breath-taking.
Or perhaps to put it another way, it’s an extreme event driven system in which a network of objects forms the architecture, (global?) events define the information flow, and the interaction of these objects defines the system behavior.
Is this understanding correct? If not, I’d love clarification and even examples of code written in this message system (vs. code that’s not), to make this concrete.
11
The key to Alan Kay’s view is the reason why a message is sent.
When an object of class A sends a message to an object of class B because A wants B to do something specific, that isn’t OO (according to Kay’s vision.) If A is sending the message to inform B that something has happened (rather than telling it to do something,) that is OO.
A good example of this is an onClick method that informs something that a button was clicked.
A bad example would be the append method on a container. This isn’t OO programming, rather it is bog standard modular programming. There’s nothing wrong with modular programming mind you, but it is different than OO.
EDIT
I feel the need to defend the above somewhat… Refer to Alan Kay’s email that was posted in the question (here). Notice quotes like, “I wanted to get rid of data.” Notice how he keeps coming back to the notion of avoiding data in favor of sending messages to objects.
When you tell a container to append, you are explicitly dealing with data. You care whether or not the container’s size attribute increased. Whenever a function is called because the caller wants to ensure the called’s post-condition, that is a reference to data, either explicit or implicit.
Mr. Kay wanted to avoid that, and this means that OO is about sending messages to inform objects of things happening, not to force them to change their state.
7