...
Excerpt |
---|
A goal of the platform is to make working with messages and state as simple as working with plain old java objects. The X Platform's Application Data Modeler (ADM) allows modeling of messages and state entities in XML and provides utilities to generate source code that is instrumented to transparently handle encoding, serialization and transactional functionality that underpin the platform. This section and its subsections will familiarize you with theses modeling constructs and code generation tools. |
- Entity
- Entities are used to model application state. In Talon, an application exposes its state to the platform by providing it with a single root object that references the rest of the application state. The single root forms and its descendent object entities form a state tree that is held fully in memory, supports transactional semantics, and is replicated asynchronously to backup instances in a delta-based pipelined fashion as application code modifies it in the course of processing.
- Message
- A message can be thought of as a special type of entity that is enhanced to allow transport over the platform's Simple Message Abstract (SMA) layer. A message can't reference other entities because it is serialized as an independently transportable unit.
Embedded EntityAnchor EmbeddedEntity EmbeddedEntity - An embedded entity models a collection of fields of primitive types or other embedded entities. An embedded entity can be embedded into a Message, Entity or other Embedded entity as a field, and become part of that type's serializable unit, e.g. not another node from the standpoint of ROG, and a transported part of a message from the standpoint of SMA. Embedded entities are serialized along with the parent Message or Entity that it is added to. Because embedded entities can be set on message types they are useful when it comes to transferring related groups of fields between messages and state.
As a convenience, there is also:
...
Composite data types are defined as entities which can contain fields that are primitive, built-in, collection, enumerations, entity or message types. Because Messages are a special case of Entities we start by describing Entities here first.
An application's state is represented as a exposed to the platform via a single root object that along with its descendant entity references form your application's state tree in which entities represent the nodeseach entity is an independently serializable node. The platform replicates the deltas to this state tree as changes are made to its nodesentities. When an entity is set as a field of another object entity in the tree it constitutes an addition to the state tree which is then replicated to other peers. Similarly when a field of an entity is removed (set to null) it constitutes a removal which is then replicated to the peers and possibly persisted.as fields on an entity are updated, the changed node is replicated to backup members, and finally, when an entity is dereferenced from the tree a remove operation is replicated.
An entity that serves as the root of an a state tree can be marked as root, which indicates it will not have any parents in the object tree. A root object should not be declared as the child of another object. Application provided state should not be defined as root objects because the server AepEngine appends them to an underlying root object internally.
...
An entity can be declared as embedded. Embedded entities are serialized as part of the entity/message to which it is declared as a field - as part of the same transported unit. Embedded entities can define fields that are primitive or built-in types, other embedded entities, or arrays, but may not use collections or non-embedded entities.
Restrictions on the use of entities as fields in other objects
...