Introduction

This proposal is in the Project Proposal Phase (as defined in the Eclipse Development Process document) and is written to declare its intent and scope. This proposal is written to solicit additional participation and input from the Eclipse community. You are invited to comment on and/or join the component. Please send all feedback to the eclipse.technology.emft newsgroup (please prefix the subject with [temporality]).

Background

Things change. When something changes one of the great benefits of computerized record keeping systems is that they allow us to easily add new records and update past records.
There are many real world examples where there is a need to keep track of the state of a piece of information over time; payroll systems, contracts, bank accounts etc.

Many software patterns have been proposed to address questions of the form: “what was the salary of Jean-Claude on Jan 12 1995” and “what did we think Jean-Claude’s salary was on June 22 1995 when we issued him a paycheque”. These patterns are sometimes referred to as Temporal Object or Temporal Attribute. See Martin Fowler’s Patterns for things that change with time article for a discussion about these patterns.

EMF provides a class called ChangeRecorder that is used to record changes done to modeled instances (EObjects). The ChangeRecorder is primarily used to implement the undo/redo mechanism in an instance editor; however the ChangeRecorder does not answer questions about the state of an object at an arbitrary date/time.

We propose modeling a Temporal base class which would be responsible of keeping track of the state of any given modeled object. Suppose you had a model consisting of a Vehicle base class.

Vehicle

brand

numberOfDoors

and a Car subclass of Vehicle:

Car -> Vehicle

colour

wheels

To add version tracking to the car you simply subclass from Temporal.

Car -> Vehicle, Temporal

Scope

Functionality initially contributed:

Retrieving attributes and references in the past/present/future.

Modifying attributes and references in the past/present/future.

Versioning of lists; retrieving, adding, removing, clearing in the past/present/future.

Propagation of modifications made to attributes and references made in the past.

Temporalization of bidirectional associations.

Temporality hooked into EMF using an EStore.

Remaining functionality:

Validation of model.

Improve versioning of lists.

Implementation of temporal Map.

Bidirectional temporal reference propagation.

Bidirectional temporal list propagation.

Bi-Temporality.

Explore alternative means of hooking into EMF.

Note that the scope can be further augmented as warranted by community interest.

Description

The functionality initially contributed will consist of an .ecore model containing the Temporal EClass. This model can be loaded using “Load Resource” into an existing model to add temporality to existing modeled classes. No modification to the genmodel templates is required. The initial contribution includes supporting .java classes and an EStore implementation to hook in the temporal behaviour. See Delegating EStore Design Document and Temporality Design Document for more details.

We also have testcasses covering most areas of the temporal functionality. The current test coverage is as follows:

Test propagation of attribute and reference modification made in the past.

Test propagation of attribute and reference modification to future versions

Test propagation done on a specific version (not through the continuity).

Test temporalization of bidirectional associations.

Remaining functionality:

Validation of model. Temporal should not be in bi-directional relationship with non-Temporal types.

Improve versioning of lists. A more efficient mechanism is needed. The current implementation simply copies the entire list when a list version is required.

Implementation of temporal Map. Maybe we can leverage the work done with EList since the Map is backed by an EList.

Bidirectional temporal reference propagation.

Bidirectional temporal list propagation.

Test mixing different granularities of time.

Bi-Temporality. As mentioned in Martin Fowler’s articles there are two types of Temporality: Regular and Bi-Temporality. The current implementation focuses on regular temporality captured in a base class called Temporal. Our approach lends itselft nicely to the addition of a BiTemporal base class to capture the bi-temporality functionality. We think this would be a very interesting addition to the Temporality component.

Relationship with other Eclipse-based Projects

Temporality builds upon the functionality provided by the EMF project itself. The Temporality design is fairly straightforward and non intrusive. It is mostly implemented using modeled EClasses and does not require any changes to JET templates used by the GenModel code generator. It also does not require any changes to the EMF source code. The Temporality component is pluged into EMF objects in using an EStore. The only code written outside the modeled EClasses is for support classes and a custom EStore processor that intercepts the eGet and eSet method calls.

The Temporality component is fundamentally generic in nature. As such this component can be leverage by any Ecore based project where there is a need to keep track of the state of modeled instances over time.

Organization

Initial committers

Jean-Claude Cote

Code contributions

Eric Ladouceur

Simon McDuff

Interested parties

Ed Merks, IBM

Interested parties are welcome to add themselves to the list above as interested parties or to suggest changes to this document.