What is an object?

An object bundles some state and behavior. Objects are accessed via capabilities and here I count Java references as capabilities. Ordinary programming data are normally used to represent the state of the object but that data is normally hidden from even those with access to the object. Only the code defining the object’s behavior has access to the data. Sometimes not even the state of the object is entirely accessible.

A capability designates some one object. We invoke a capability by sending a request via that capability. Normally a response is subsequently delivered to the invoker. Requests and responses are messages. To invoke an object is to invoke a capability to that object. In the case of Java, or its predecessors, we consider the method name as part of the request and the type of any exception thrown, as part of the response.


The “functions” referred to above compose the behavior of the object.

Alas it is more complicated than the above but the above is a good place to start.

The state of object X may include a capability to yet another object Z. The behavior of X may include invoking Z. The message invoking Z may depend on the state of X and the response from Z may effect the subsequent state of X. To fit the above ideal it is necessary to include the state of Z in the state of X. Objects X and Y can both include the same capability to Z. Now the third ideal principle is violated for an invocation of X may change the state of Z which belongs to the state of Y!

There may be several capabilities to the same object. We will call these facets of that object. We could document the situation of the previous paragraph as follows: Capabilities X and Y are two facets of the same object. In Keykos, E and Joule, facets are provided in the foundation which means there may be distinct capabilities to an object implemented in the foundation. In Java however, references to a particular class instance are all the same. The effect of facets may be had, however, by another layer as described above.

Whether objects are actually implemented in layers, as above, and whether they are documented that way, are entirely independent issues. It is an important flexibility that the documentation not constrain the implementation. Keykos does not allow the holder of capabilities X and Y to determine whether they designate the same object.

Alas it is yet more complicated in Keykos at least. The above would suggest a strict pairing between requests and responses. Yet more general patterns are possible and very useful. This gives the rules fairly concisely, where “key” means capability.

See this about conceptual descriptions of objects, and how they relate to implementation schemes.