160 likes | 310 Views
Dagstuhl Seminar January 16-21, 2011 - Bidirectional Transformations. Co-Evolution of Schemas and Programs using Coupled Transformations Anthony Cleve & Jean-Luc Hainaut. Transformational database engineering. Most database engineering processes including: Database design
E N D
Dagstuhl Seminar January 16-21, 2011 - Bidirectional Transformations Co-Evolution of Schemas and Programs using Coupled Transformations Anthony Cleve & Jean-Luc Hainaut
Transformational database engineering • Most database engineering processes including: • Database design • Schema refactoring • Database platform migration • Schema evolution • … • … can be modelled as chains of schema transformations
A schema transformation can ... augment the information contents of the schema decrease the information contents of the schema preserve the information contents of the schema Information-preservation
DOCUMENT DocID Title BOOK Date-Published ISBN Keyword[0-10] Publisher id: DocID DOCUMENT id: ISBN COPY BOOK DocID AUTHOR ISBN ISBN Title Name 0-N Serial-No Publisher written 0-N 0-N Date-Published First-Name Date-Acquired id: ISBN Keyword[0-10] Origin of id: ISBN id: DocID Serial-No 1-1 ref: ISBN COPY Serial-No Date-Acquired id: of.BOOK Serial-No DOCUMENT DocID AUTHOR Title Name Date-Published First-Name Keyword[0-10] Origin DOCUMENT id: DocID DocID KEYWORD 0-N Title describe Keyword 0-10 1-N 0-N Date-Published id: Keyword WRITTEN id: DocID doc by 1-1 1-1 id: doc.DOCUMENT by.AUTHOR Elementary vs compound transformations Elementary transformations
Compound transformations known known known known Elementary vs compound transformations new!
Main problem: co-evolution of databases and programs • The question is… • How to preserve the consistency between a database subject to evolution and the application programs accessing it? • In particular… • How to propagate schema transformations to application programs? • Our proposal… • Let’s use coupled transformations (or co-transformations), combining schema, data and program transformations • Let’s consider elementary co-transformation rules, to be composed later on
T1 = Transformation of a compound, multi-valued attribute A into an entity type EA EA A1 A2 E ... B An R 0-N 1-1 C id: R.E id: B A1 A2 ... An Co-transformations T1
T2= Transformation of a one-to-many relationship type R into a foreign key E Id1 ... Idn E2 A1 0-N R 1-1 B1 A2 B2 id: Id1 ... Idn Co-transformations T2
T2oT1= Transformation of a multi-valued, compound attribute A into an entity type EA + a foreign key Compound co-transformations T2 o T1
Schema refactoring Database platform migration Database design Application scenarios Ex. split a relational table T3 oT2 oT1 T1 T3 T2 ADDRESS CUSTOMER Street CusId R 1-1 1-1 Number Name ZipCode id: CusId City
CUSTOMER CusId T2 oT1 Name ORDERS Address OrdId C-O 1-1 Street 0-N Date Number id: OrdId ZipCode City id: CusId CUSTOMER CusId ORDERS Name OrdId Street C-O 1-1 0-N Date Number ZipCode id: OrdId City id: CusId Application scenarios Schema refactoring Database platform migration Database design Ex. CODASYL to relational schema conversion T1 T2
Application scenarios Schema refactoring Database platform migration Database design Tn o …. o T2 oT1
From schema transformation to schema mapping Idea propagate mapping « stamps » through successive schema transformations derive mapping between source and target schemas
From schema mapping to program transformation/generation • Schema refactoring [1] : program transformation • ex. rewriting SQL queries • Database migration [2, 3] : inverse wrapper generation • ex. providing a CODASYL view of a relational database Database design [4] : conceptual API generation providing a ER view of a relational database • [1] Anthony Cleve and Jean-Luc Hainaut. Co-transformations in database applications evolution. In Ralf Lämmel, Joost Visser and Joaõ Saraiva, editors, Generative and Transformational Techniques in Software Engineering (GTTSE’2005), volume 4143 of Lecture Notes in Computer Science, pp 409–421. Springer, 2006. [2] Anthony Cleve, Jean Henrard, Didier Roland, and Jean-Luc Hainaut. Wrapper-based system evolution - application to CODASYL to relational migration. In Proceedings of the 12th European Conference in Software Maintenance and Reengineering (CSMR’08), pp 13–22. IEEE, 2008. [3] Jean-Luc Hainaut, Anthony Cleve, Jean Henrard, and Jean-Marc Hick. Migration of legacy information systems. In Tom Mens and Serge Demeyer, editors, Software Evolution, pp 105–138. Springer, 2008. [4] Anthony Cleve, Anne-France Brogneaux and Jean-Luc Hainaut. A Conceptual Approach to Database Applications Evolution. In Proceedings of the 29th International Conference on Conceptual Modelling (ER’2010). pp , volume 6412 of Lecture Notes in Computer Science, pp 132-145, Springer, 2010.
Conclusions and observations • Semantics-preserving schema transformations can be automatically propagated to programs • Elementary and generic schema co-transformations can be reused and combined to support several database evolution scenarios • The combination of transformational and generative techniques provides a sounds basis for automated co-evolution of databases and programs • Some challenges ahead: • Dealing with increasing complexity and dynamicity in data management • Supporting non-semantics-preserving database evolutions • Facilitating ORM-based system evolution • Propagating database evolutions to other system artefacts