The Talon Manual

Skip to end of metadata
Go to start of metadata

 

 

In This Section

Overview

There are a few restrictions enforced by the current state model that application developers must be aware of when designing state models and authoring applications. This section outlines these restrictions and discusses some of the planned enhancements to the state model under consideration.

Single Parent Restriction

Currently, an entity may only be placed in the state tree as the field of a single parent object. Using the same object instance in the tree in multiple locations is not supported.

(lightbulb) Attempting to set an entity as a field of another entity when it already set as field elsewhere in the state tree will result in an IllegalStateException at runtime. 

In general, this limitation can be worked around by storing the entity it in Map and referencing by a field that identifies the object by an id. For example, if a Customer object needs to be referenced in multiple places in the state tree, Customers can be held in a Customers map and each place in the tree can reference the Customer by its id. 

Multiple Entity Fields of Same Type

Transactional entities don't currently support multiple fields of the same entity type. The following is not supported due to current limitations in the underlying transaction machinery. It is expected that this limitation will be relaxed in a future release. 

The above will yield a "Duplicate entity fields of the same type 'com.example.models.state.Parent'... an entity cannot have two non embedded entity fields of the same type" error message during code generation.

(lightbulb) Note that it is permissible to declare multiple embedded entity fields of the same type.

State Tree Cycles

As a corollary to the Single Parent Restriction, cycles in the state tree are not supported (including self-references).

(lightbulb) The Application Data Modeler will, by default, not permit data models that contains cycles in the resultant state tree. 

Support for state tree cycles of non-field entities is under consideration in future versions of the platform.  

Primitive Collections

It is not currently possible to define collections with primitive value types. 

Inheritance and Polymorphism

Support for Inheritance is under consideration for a future platform version. Currently, the platform supports entity inlining to provides polymorphism. Application developers should be aware, however, the polymorphism can have a significant impact on Java performance, which is in part why there is a reluctance to introduce this feature. 

  • No labels