Uses of Tuple data

An Object-Relational data engine in the framework core provides a type system and a common Tuple based data model interface. The data engine is used to model and manipulate relational data, and enables a variety of configuration and persistence related features.

Multiple storage mechanisms can participate in an application. Implementations for XML, SQL and CSV are available, along with mapping mechanisms.

In addition to providing a queryable relational model and a data modification toolkit, the data engine can transfer state to and from the public interface of any reachable Java object. The separation of the data management concern from procedural logic facilitates both the manipulation and persistence of Java objects as data and the implementation of data transformations in Java code.

The following scenarios are those that are common, but it is possible to mix and match the framework features to handle novel situations.

Business Objects

This scenario refers to applications which manipulate data that models some external entity. The data is typically stored in a relational database, and would be exposed to framework applications via a SQL Store instance.

The framework data models include declarations for relational integrity constraints and field validation rules that are transferred to the data store to the extent that they are supported by the store, and implemented by the framework where they are not.

Embedded datastore

An application that wants to store data locally (preferences, for instance) or embed it in or associate it with another format (to tag an archive with some metadata, for instance) would use an XML Store or the spiralcraft.data.sax API to read and write data according to a predefined type model.

Persistence and Configuration mechanism

In the data engine, every Java class is mappable through a data type.

The data engine can be used to store configuration data and apply it directly to the public interface of a POJO. At a higher level, it can be used to persist trees of POJOs (and graphs, in the future).

This functionality can also be employed to create a state transport mechanism.

Transactional Live Object Editor

In the data engine, every Java class is mappable through a data type.

Generic UI or programmatic tools created to read and edit data can be purposed to read and edit active POJOs (Java objects). Instead of writing their state to a data store, the edit buffers update a Java object in the framework. (note: this is experimental right now) The operation is performed in a transaction context, so the POJO can accept the data update atomically, to the extent it is aware of the transaction context.