LivCos

Source Code Paths

1 Introduction

2 Entity ID Management

2.1 Setting "id" Attribute

3 Code Path TODOs

1 Introduction

Some processes in the LivCos application are best explained with the source code involved.

2 Entity ID Management

The ID values of the entity elements are managed automatically. Whenever a new entity is inserted, it's ID value will be checked to be unique within the object.

2.1 Setting "id" Attribute

-- method /livcos.org/data/impl/livcos_0.7.1/org/livcos/cosmos/core/ElementNode#method_23--

Set any value to an "id" attribute of a content element node (entity element).

-- method /livcos.org/data/impl/livcos_0.7.1/org/livcos/cosmos/node/object/ObjectDataNode#method_55--

The set-attribute event is fired. The object, containing the entity, is registered to handle this event.

-- method /livcos.org/data/impl/livcos_0.7.1/org/livcos/cosmos/node/object/ObjectDataNode#method_24--

First we collect the currently existing ID values with a certain prefix.

-- method /livcos.org/data/impl/livcos_0.7.1/org/livcos/cosmos/node/object/ObjectDataNode#method_22--

If the value already forms the ID for another entity, we create a new one and replace the original setting.

-- method /livcos.org/data/impl/livcos_0.7.1/org/livcos/cosmos/core/AttributeNode#method_6--

This again fires a set-attribute event.

-- method /livcos.org/data/impl/livcos_0.7.1/org/livcos/cosmos/node/object/ObjectDataNode#method_55--

This time it is unique and we don't need to create and set another new value.

3 Code Path TODOs

TODO:

 Allow to suppress return values, when it's not of any interest for the topic to explain.

TODO: Allow to name instances to be called.

TODO: Allow to document concurrent events.

TODO: Point a code walk to a specific source code revision.

 

View and print in PDF