petervandenabeele/dbd

View on GitHub
docs/stories/006_refactor_fact_origin_to_provenance_fact.txt

Summary

Maintainability
Test Coverage
006_refactor_fact_origin_to_provenance_fact

As a client
I can use a ProvenanceFact

* a ProvenanceFact is a subclass of a Fact
  with additional features:
  * it's time_stamp must be earlier than any Fact that
    refers to it through it's provenance_fact_subject.
    (otherwise said: the collection of ProvenanceFacts
     about a subject must be complete before it is used;
     no provenance_fact may be added about a fact that
     already in the fact stream)
* a graph is represented internally as a single
  fact_collection
* for the provenance_facts, efficient access to all
  provenance_facts by_subject is possible with a
  ruby Hash (internally coded in O(1) in C)

* Facts are ordered by time_stamp