Application Development, Product to Market
  • Home
  • Notes
  • Projects
  • Resources
    • Discovery Log
    • Books I Read
    • Blogs I Visit
    • Tools I Use
  • Home
  • Notes
  • Projects
  • Resources
    • Discovery Log
    • Books I Read
    • Blogs I Visit
    • Tools I Use

Temporal Collection

5/25/2020

0 Comments

 

overview

A temporal collection is a simple way to implement a Temporal Property or a Temporal Object.
​

A temporal instance (either a Temporal Property or Temporal Object), when going through a series of amendments, the property itself or the properties the object references change over time. Each version of the temporal instance captures the state of the instance that will last for some period of time until the instance changes again with another amendment.​

implementation

Temporal Collection

The basic representation and interface for a temporal collection provides get and put operations that use a date as an index:
TemporalCollection Interface

    
Single Temporal Collection

​The temporal collection implementation can use a Map<K,V> to keep track of the changes.

A Single Temporal Collection is an implementation of Temporal Collection. A Single Temporal Collection keeps track of changes of an instance over time - over a single kind of time. That is, the updated time which is also the effective time.
SingleTemporalCollection Class

    
[1] Temporal Collection is backed by a private HashMap<K,V>. This HashMap contains the values indexed by the effective date (the date of when they become effective).
​[2] milestones() returns a List of keys (effective dates) in a reverse order from the MashMap.
​[3] get() works through these milestones to find the right key (effective date). This algorithm works best when you are more likely to ask for the most recent value.
[4] Sorts the specified list into reverse order. All elements in the list must implement the Comparable interface.
Bi-Temporal Collection

A Bi-Temporal Collection is also an implementation of Temporal Collection. A Bi-Temporal Collection keeps track of changes of an instance over time. Two kinds of time are involved. That is, the updated time and the effective time of the change, both times can be different.
BiTemporalCollection Class

    

examples / usages

Temporal Property vs. Temporal Object

If you want the underlying implementation tracks the changes of an instance at the property level but not at the object level, implement Temporal Property.
Temporal Property

    
[1] addresses is a Single Temporal Property
[2] names is another Single Temporal Property
​

On the other hand, if the changes at the object level are to be stored in some sort of version history, implement Temporal Object.
Temporal Object

    
[1] Temporal Collection is for storing version history of CustomerVersion
​
When a class has a few properties that has temporal behavior and you want access to those temporal values, use Temporal Property. Whereas, if most of the properties of the class are temporal, use Temporal Object.

references

  • Temporal Object
  • Temporal Property​
  • Java – Collections sort() method
  • Jetbrains / MPS​​
0 Comments



Leave a Reply.

    Categories

    All
    Algorithm
    Concurrency
    CQ
    Data Structure
    Design Pattern
    Developer Tool
    Dynamic Programming
    Entrepreneur
    Functional Programming
    IDE
    Java
    JMX
    Marketing
    Marklogic
    Memory
    OSGI
    Performance
    Product
    Product Management
    Security
    Services
    Sling
    Social Media Programming
    Software Development

    Feed Widget

    Archives

    May 2020
    March 2020
    April 2018
    March 2018
    February 2018
    December 2017
    March 2017
    November 2016
    June 2016
    May 2016
    April 2016
    October 2015
    September 2015
    August 2015
    September 2014
    July 2014
    June 2014
    May 2014
    March 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    July 2013
    June 2013

    RSS Feed

in loving memory of my mother  and my 4th aunt
Photos used under Creative Commons from net_efekt, schani, visnup, Dan Zen, gadl, bobbigmac, Susana López-Urrutia, jwalsh, Philippe Put, michael pollak, oskay, Creative Tools, Violentz, Kyknoord, mobilyazilar