Two object categories:
Variable state objects (or services) and immutable value objects (or structures)

These are state objects (services)

These are value objects (structures)

Problem statement

State objects

The essence of a state object is that new values may be assigned to its member variables ("properties") again and again, and that two state objects are considered to be "equal" if they are identical, i.e., the same object. Copying/cloning a state object contradicts their "uniqueness semantics".

Value objects

The essence of a value object is that its member variables ("attributes") are "frozen" (= write-locked) when the object leaves the (executable) "new" construct (which creates new objects of some specifiable type and category). Comparing two value objects amounts to a recursive comparison of all their constituents.

Declaration of state and value objects

Lava objects can be referenced only indirectly as values of Lava variables: Lava variables point to Lava objects, they are always of "reference type" as you would say in Eiffel or Java. Several variables may point to the same object. The data type of a Lava variable v is described by a Lava class, say A. The value of a Lava variable may be any object that supports A (or an class derived from A) and that has the category specified for v.

The same Lava class may be used to declare variables of either category : state or value. The category is specified as part of Lava variable declarations. If a variable is declared to be of the "state object" category then a "~" (tilde) precedes the name of the class that specifies the data type of the variable.

A variable may be

See also: Stages in the life of Lava objects (sample)

Component objects

are special state objects that are dynamically created or static "inhabitants" of "components". Components are dynamically loadable software modules in which component objects may be activated/created that can communicate with other component objects over well-defined language-independent function-call interfaces.

See also: Lava as a component integration language

Persistent, particularly database objects

Persistent objects are component objects that can be "attached" by other components. It is expected that they exist already at this time, although they may exist in a deactivated state and thus must be activated before they are attached. In Lava, databases are treated as special persistent objects.

 

Summary: State and value objects

Value objects ... State objects ...
... are frozen after completion ... can be changed again and again even after completion
... serve, e.g., as messages exchanged between and as member objects of state objects ... provide continuous services
Equal relation ("=") compares values ("equality semantics") Equal relation ("=") compares pointers ("identity semantics")
... are passed by value between, by reference within components ... are always passed by reference
... can be persistent only as constituents of component objects ... can be persistent component objects
Their member objects are usually accessed directly Their member objects are usually accessed via set/get functions, those of component objects always

See also:

State/value objects (sample)

Stages in the life of Lava objects (sample)