Instituto de Informática Universidade Federal do Rio Grande do Sul Porto Alegre - RS - BRAZIL
Adding Time to an Object-Oriented Versions Model Mirella Moura Moro Nina Edelweiss INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Silvia Maria Saggiorato Clesio Saraiva dos Santos
Outline • • • • • • •
Introduction Objective Basic Concepts Temporal Versions Model Example Implementing TVM Concluding Remarks
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Introduction • Version: describes an object in a period of time or from a certain point of view • Temporal Model: specifies both static and dynamic aspects of the application by associating temporal labels
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Objective VERSIONS
TIME
Project Alternatives
Evolution History
Temporal Versions Model INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Objective
Alternatives
V5 V3 V1
V6
V4
V2 Derivation and data history
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Basic Concepts • Versions Model • Temporal information – order: linear, branched, circular – timestamp: instant, interval, element – time dimension: transaction time, valid time, bitemporal
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Temporal Versions Model TEMPORAL FEATURES
• • • • •
object, version, attribute, relationship temporal label: interval bitemporal (valid and transaction times) object and versions: start & end temporal label: vTimei, vTimef, tTimei, tTimef
• version: a lifetime line • object: branched time (each version) INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Temporal Versions Model TEMPORAL FEATURES - ATTRIBUTES start CL
VO
start
start
Class
v2
start
start
v1
Legend
start
Versioned Object
end
v4
v3
t4 t3 t2 t1 T0 INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
t3End
Version
t v4 t v3 t v2 t v1 T VO
Temporal Versions Model LOGICAL AND PHYSICAL REMOVAL
• LOGIC – version ⇒ status deactivated – lifetime finished • end = exclusion instant • vTimef, tTimef = end
• PHYSICAL – reduce the database size – lost information = lost historic
• all exclusions are logical INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Temporal Versions Model TEMPORAL INTEGRITY RULES Valid Time start VTransaction Time start Lifetime vTimei V a start tTimei vTimei OV a a a a
end
t
vTimefend
t t tTimef end vTimef t t vTimei vTimef tTimei tTimef start end a v t t tTimei vTimei vTimef start end tTimef a v t t tTimeistarttTimef end a v t start end v
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
t t t t t
Temporal Versions Model VERSION FEATURES
• versioned objects and versions • derivation among versions: directed acyclic graph • tvOID structure
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Temporal Versions Model CLASS DIAGRAM (Golendziner)
Object
Versioned Object
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Version
Temporal Versions Model CLASS DIAGRAM Inheritance navigating
Object User’s Application Class non temporal non versionable
Versioning methods and attributes
Temporal Object
Temporal Version
User’s 1* temporal and Application versionable Class INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Temporal methods
Versioned Object Control 0..1 Control of versioned objects
Modelo Temporal de Versões STATE DIAGRAM TemporalVersion Working
derive
derive Stable
derive promote
Consolidated
promote States
restore
restore
delete
delete Deactivated
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
derive promote update exclude query share restore
W –
S –
C – –
D – –
Temporal Versions Model CLASS DEFINITION LANGUAGE classDef ::= [ public ][ abstract | final ] class className [ hasVersions ] [ inherit [ byExtension] className [ correspondence (1:1 | 1:n | n:1 | n:m)] ] [ [ temporal ] aggregateOf [n] className ( byValue | byReference ) {, [ temporal ] aggregateOf [n] className ( byValue | byReference )} ] ( [ Properties: {
[ public | private | protected ] [ static ] [ temporal ] attributeName : attributeDomain [ default value ] ; }+ ]
[ Relationships: { [ temporal ] relationshipName (0:1 | 0:n | 1:1 | 1:n | n:m) [ inverse inverseRelationshipName ] relatedClassName ; }+ ] [ Operations: { [ public | private | protected ] [ static ] [ abstract | final ] operationDefinitions }+ ] ) ; INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Example • Website design company • Pages with pattern associated to • Pattern varies according to the seasons of the year and commemorative dates
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Example CLASS DIAGRAM 0..n associatedWith
WebSite URL online
0..1
initial Page
1..1
PagePattern patternName backgrdColor backgrdImage banner
0..n
default
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Font fontType fontSize 1..1 fontColor fontEffect
1..1
WebPage 1..n pageTitle pageText
Example DEFINITION LANGUAGE Class WebSite HasVersions aggregate_of n WebPage byReference ( Properties: temporal URL : string ; temporal online : boolean; Relationship: temporal initialPage 1:1 WebPage; temporal associatedWith 1:1 PagePattern; ) ; Class WebPage HasVersions ( Properties: temporal pageTitle : string; temporal pageText : text; ) ; ... INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Example GRAPHIC REPRESENTATION PagePattern Autumn 1,15,0
Winter 2,15,0
Spring 3,15,0
Summer 4,15,0
Winter 2,15,2
2,15,1 Winter brightGreen sun2.gif winterAd
Christmas white deriveVersion santaClaus5.gif christmasAd
2,15,2 Christmas white santaClaus5.gif Dec23thAd 2,15,4
deriveVersion
2,15,3 deriveVersion
ChristmasB brightRed santaClaus7.gif christmasAd3
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
NewMillenium brightSilver new2001.gif odysseyAd
Exemplo RELATIONSHIP AssociatedWith WebSite 2,8,1
WebSite 2,8,1
WebSite 2,8,1
WebSite 2,8,1
PagePattern 2,15,1
PagePattern 2,15,2
PagePattern 2,15,4
PagePattern 2,15,1
Dec 21th
Dec 22th
Dec 26th
Jan 2nd
Initial Final Initial PagePattern Transaction Transaction Valid associatedWith Time Time Time 12/01/2000 >> 12/21/2000 2,15,1 12/01/2000 >> 12/22/2000 2,15,2 12/01/2000 >> 12/26/2000 2,15,4 12/01/2000 >> 01/02/2001 2,15,1 INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
t Final Valid Time 12/21/2000 12/25/2000 01/01/2001 >>
Example ADVANTAGES
• Evolution of the clients’ website is stored • Company has the employee historical information • Discover patterns and clients’ profiles by using data mining techniques
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Implementing TVM MODEL HIERARCHY MAPPING
• Existing commercial DBMS • Mapping from TVM to DB2 • Class hierarchy > type hierarchy methods: SQL commands + queries • Object, TemporalObject, TemporalVersion: NOT intantiable structured type • VersionedObject (control): instantiable by the system – table VersionedObjects: store all instances INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Implementing TVM COMPLEMENTARY MAPPING
• OID: elements > varchar attribute separated by commas (‘101,20,5’) • METADATA – CONTROL_CLASS: • • • • •
ID_CLASS CLASS VERSIONED IS_ROOT ASCENDANT
• Temporal labes: TEMPORALSTAMP INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Implementing TVM APPLICATION CLASSES MAPPING
• NORMAL CLASS 1. a structured type: class structure 2. a table: stores class instances
• TV CLASS 1. a structured type 2. a table 3. a table for each temporal property 4. triggers: temporal and version updates
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Implementing TVM APPLICATION CLASSES MAPPING PagePattern tvOID start end ascendant configuration descendant predecessor status successor refVersObjects patternName backgrdColor backgrdImage banner refPagePatternBanner INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
PagePattern_Banner tvOID vTimei vTimef tTimei tTimef refPagePattern banner
Concluding remarks • Temporal Versions Model as an application specification technique for dynamic systems (time-evolving systems) • Extension of the Versions Model by adding time features • Design alternatives and data evolution
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Concluding remarks • For each version, every update in attributes and relationships values defined as temporal are stored • Different versions coexist: branched time order • Integration with existing specifications: the Model does not require all classes to be temporal and versionable INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Concluding remarks • On-going work: – Environment for class specification, object versioning, versions management, query, and visualization – Schema evolution model – Extender for DB2
INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL
Instituto de Informática Universidade Federal do Rio Grande do Sul Porto Alegre - RS - BRAZIL
Adding Time to an Object-Oriented Versions Model
[email protected] INSTITUTO DE INFORMÁTICA - UFRGS - BRAZIL