[erlang-questions] object vs. actor (Re: Massive Numbers of Actors vs. Massive Numbers of Objects vs. ????)
Thu Mar 1 00:11:55 CET 2012
Raoul Duke wrote:
> question: what is the difference between an actor and an object? i
> have seen so many different definitions of the things! the words seem
> to be heavily context-dependent.
My understanding (and how I differentiate):
- an object encapsulates state and methods, but is not "active" -
depending on the environment, methods can be invoked by procedure call
or message passing (it's a chunk of data bound to methods for
manipulating that data)
- an actor also encapsulates state and methods, but is "active" - it's a
running process that's listening for and responding to messages (it's a
There are, of course, more formal definitions. Hewitt is sort of the
definitive source for defining the actor formalism. Not sure who's his
counterpart for objects.
What it always comes down to, for me, is flow of control. Objects just
sit there, until some thread winds through them, or until triggered by
an event. Actor based systems consist of massive numbers of
concurrently executing processes. Very different ways of thinking about
things at a systemic level.
Of course these are only my views - your mileage may vary.
In theory, there is no difference between theory and practice.
In practice, there is. .... Yogi Berra
More information about the erlang-questions