1 / 13

Using program transformations to add structure to a legacy data model

Using program transformations to add structure to a legacy data model. Mariano Ceccato (1) , Thomas Roy Dean (2) , Paolo Tonella (1) (1) FBK-IRST, Trento, Italy (2) Queen’s University, Kingston, Canada. Migration project. User interface Character oriented. User interface Graphical.

mitch
Download Presentation

Using program transformations to add structure to a legacy data model

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using program transformations to add structure to a legacy data model Mariano Ceccato(1), Thomas Roy Dean (2), Paolo Tonella(1) (1) FBK-IRST, Trento, Italy (2) Queen’s University, Kingston, Canada

  2. Migration project User interface Character oriented User interface Graphical Business logic BAL language Business logic Java language Data ISAM tables Data Relational database Reverse engineering Restructuring Migrated code Information and models Automated code transformation

  3. Primitive types in BAL DCL a# // byte DCL b% // short DCL c& = 5 // BCD, 5 bytes long DCL d$ = 100 // string, 100 bytes long DCL e$ // string, 16 bytes long DCL f$ = 10(20) // array of 20 strings, // each 10 bytes long DCL g&=8(10,10) // 10x10 matrix of BCDs, // each 8 bytes long

  4. Variable declarations a b c #ifdefA DCLa$ = 9 FIELD = M, a DCLb$ = 5 DCLc$ = 5 FIELD = M, b DCLd# DCLe# DCLf$ = 4 FIELD = M, c DCL g% FIELD = M #endif d e f g Fields do not introduce any additional lexical scope. Sizes may be incorrect (no compile time check). The same layout in memory can be expressed in many different ways.

  5. Approach • Adding structure • Square brackets […]: boundaries of each redefinition • Square-angle brackets [<…>]: redefinitions of each declaration • Translating to Java • Square brackets […]: boundaries of classes (nesting represents composition) • Square-angle brackets [<…>]: unions, when >1 redefinition (copy on read/write)

  6. Square bracketing DCLa$ = 9 FIELD = M, a DCLb$ = 5 FIELD = M, b DCLd# DCLe# DCLf$ = 3 DCL c$ = 3 DCLa$ = 9 FIELD = M, a 9 [ ] DCLb$ = 5 FIELD = M, b 5 [ ] DCLd# DCLe# DCLf$ = 3 DCL c$ = 3

  7. Folding declarations DCLa$ = 9 FIELD = M, a 9 [ ] DCLb$ = 5 FIELD = M, b 5 [ ] DCLd# DCLe# DCLf$ = 3 DCL c$ = 3 DCLa$ = 9 FIELD = M, a 4 [ DCLb$ = 5 ] FIELD = M, b 5 [ ] DCLd# DCLe# DCLf$ = 3 DCL c$ = 3 DCLa$ = 9 FIELD = M, a 4 [ DCLb$ = 5 ] FIELD = M, b 4 [ DCLd# ] DCLe# DCLf$ = 3 DCL c$ = 3 DCLa$ = 9 FIELD = M, a 4 [ DCLb$ = 5 ] FIELD = M, b 3 [ DCLd# DCLe# ] DCLf$ = 3 DCL c$ = 3 DCLa$ = 9 FIELD = M, a 4 [ DCLb$ = 5 ] FIELD = M, b 0 [ DCLd# DCLe# DCLf$ = 3 ] DCL c$ = 3

  8. Folding redefinitions DCLa$ = 9 FIELD = M, a 4 [ DCLb$ = 5 ] FIELD = M, b 0 [ DCLd# DCLe# DCLf$ = 3 ] DCL c$ = 3 DCLa$ = 9 FIELD = M, a 4 [ DCLb$ = 5 FIELD = M, b 0 [ DCLd# DCLe# DCLf$ = 3 ] ] DCL c$ = 3

  9. Iterating (fold declarations) DCLa$ = 9 FIELD = M, a 4 [ DCLb$ = 5 ] FIELD = M, b 0 [ DCLd# DCLe# DCLf$ = 3 ] DCL c$ = 3 DCLa$ = 9 FIELD = M, a 1 [ DCLb$ = 5 FIELD = M, b 0 [ DCLd# DCLe# DCLf$ = 3 ] DCL c$ = 3 ]

  10. Size mismatches Heuristic stopping conditions: Redefinition explicitly closed by FIELD=M Another redefinition of the same field starts A redefinition of another field starts End of declarations is reached in the code

  11. Square-angle bracketing DCLa$ = 9 FIELD = M, a 1 [ DCLb$ = 5 FIELD = M, b 0 [ DCLd# DCLe# DCLf$ = 3 ] DCL c$ = 3 ] FIELD = M, a 0 [ DCLg$ = 2 DCLh$ = 2 DCLi$ = 5 ] DCLa$ = 9 [< >] FIELD = M, a 1 [ DCLb$ = 5 [< >] DCL c$ = 3 ] FIELD = M, a 0 [ DCLg$ = 2 DCLh$ = 2 DCLi$ = 5 ] FIELD = M, b 0 [ DCLd# DCLe# DCLf$ = 3 ]

  12. Move redefinitions DCLa$ = 9 [< FIELD = M, a 1 [ DCLb$ = 5 [< FIELD = M, b 0 [ DCLd# DCLe# DCLf$ = 3 ] >] DCL c$ = 3 ] FIELD = M, a 0 [ DCLg$ = 2 DCLh$ = 2 DCLi$ = 5 ] >] DCLa$ = 9 [< >] FIELD = M, a 1 [ DCLb$ = 5 [< >] DCL c$ = 3 ] FIELD = M, a 0 [ DCLg$ = 2 DCLh$ = 2 DCLi$ = 5 ] FIELD = M, b 0 [ DCLd# DCLe# DCLf$ = 3 ]

  13. Results • 510,108 variable declarations have been structured • 29,394 unions have been recognized • 81,900 redefinitions managed automatically • A few size mismatches not managed automatically (fixed manually in < 1 working week) • Java classes generated for all structured declarations, including unions

More Related