The substantive importance is that the representation of an individual actor now presumes that the actor is a self-contained entity and that other actors do not automatically have access to all information inside that actor. Like humans, objects have to take effort to convey information to each other about their internal states. The practical advantages of encapsulation, however, are just as important. For example, if an object groceryStore can respond to an message takeMoney , and it gets the job done, we might not care how it does it. Each subclass inherits all variables and methods of its superclass.
Inheritance works because code for each class designates that class as a subclass of a superclass.
From the object class, the Swarm libraries create subclasses, and subclasses are created from them, and so forth until the programmer in a swarm project wants to create a new class of actors that is subclassed from SwarmObject . If the programmer needs to create several varieties of that class, there is no need to totally rewrite each one. Subclasses can be created that have as a base all variables and methods of the class but then new methods and variables can be added as well. When a method, say takeMoney , exists in a class Store , and then a subclass is created, say GroceryStore , then all objects instantiated from the subclass will respond to takeMoney . If the programmer wants to rewrite the takeMoney method for GroceryStore s, however, then the method can be revised inside the code for the subclass and then all instances of the GroceryStore class will respond to takeMoney in that specialized way.