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,

Slides:



Advertisements
Similar presentations
Introduction to C Programming
Advertisements

CPSC 388 – Compiler Design and Construction
CS 11 C track: lecture 7 Last week: structs, typedef, linked lists This week: hash tables more on the C preprocessor extern const.
IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
Programming Languages and Paradigms
Local Variables and Scope Benjamin Fein. Variable Scope A variable’s scope consists of all code blocks in which it is visible. A variable is considered.
1 ADT and Data Structure Example Generics / Parameterized Classes Using a Set Implementing a Set with an Array Example: SetADT interface Example: ArraySet.
Chapter 5: Elementary Data Types Properties of types and objects –Data objects, variables and constants –Data types –Declarations –Type checking –Assignment.
Semantic analysis Parsing only verifies that the program consists of tokens arranged in a syntactically-valid combination, we now move on to semantic analysis,
Arrays  Writing a program that uses a large amount of information.  Such as a list of 100 elements.  It is not practical to declare.
The Analytical Engine Module 6 Program Translation.
Developing Software Applications Introduction to Programming Fundamentals Scoping in VB Simple Ifs in VB.
Chapter 3 Program translation1 Chapt. 3 Language Translation Syntax and Semantics Translation phases Formal translation models.
The environment of the computation Declarations introduce names that denote entities. At execution-time, entities are bound to values or to locations:
PZ04A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ04A - Scalar and composite data Programming Language.
Review CSC 171 FALL 2004 LECTURE 21. Topics Objects and Classes Fundamental Types Graphics and Applets Decisions Iteration Designing Classes Testing and.
1 CSCE 1030 Computer Science 1 Arrays Chapter 7 in Small Java.
Peter Juszczyk CS 492/493 - ISGS. // Is this C# or Java? class TestApp { static void Main() { int counter = 0; counter++; } } The answer is C# - In C#
Create Forms Lesson 5. Software Orientation Creating Forms A form is a database object –enter, edit, or display data from a table or query Providing.
Principles of Computer Programming (using Java) Review Haidong Xue Summer 2011, at GSU.
© The McGraw-Hill Companies, 2006 Chapter 1 The first step.
Chapter 6Java: an Introduction to Computer Science & Programming - Walter Savitch 1 l Array Basics l Arrays in Classes and Methods l Programming with Arrays.
The Center for Advanced Research In Software Engineering (ARISE) The University of Texas at Austin Reengineering of Large-Scale Polylingual Systems Mark.
CIS Computer Programming Logic
Tutorial 11 Using and Writing Visual Basic for Applications Code
Names Variables Type Checking Strong Typing Type Compatibility 1.
A First Book of ANSI C Fourth Edition
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 11: Compiler II: Code Generation slide 1www.idc.ac.il/tecs.
Introduction to Software Testing Chapter 8.1 Building Testing Tools –Instrumentation Paul Ammann & Jeff Offutt
Object Oriented Programming Lecture 5: Arrays and Strings Mustafa Emre İlal
Compiler Construction Dr. Noam Rinetzky and Orr Tamir School of Computer Science Tel Aviv University
Guide to Oracle 10g ITBIS373 Database Development Lecture 4a - Chapter 4: Using SQL Queries to Insert, Update, Delete, and View Data.
CS-1030 Dr. Mark L. Hornick 1 C++ Language Basic control statements and data types.
Java Basics.  To checkout, use: svn co scb07f12/UTORid  Before starting coding always use: svn update.
August 6, 2009 Data Types, Variables, and Arrays.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 5A Repetition (Concepts)
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
12/8/2015\course\cpeg323-07Fs\Topic2b-323.ppt1 Topic 2b High-Level languages and System Software (Languages) Introduction to Computer Systems Engineering.
Arrays. Related data items Collection of the same types of data. Static entity – Same size throughout program.
RUBY by Ryan Chase.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
 2003 Prentice Hall, Inc. All rights reserved. 1 IS 0020 Program Design and Software Tools Preprocessor Midterm Review Lecture 7 Feb 17, 2004.
CSI 3125, Preliminaries, page 1 Data Type, Variables.
C++ for Java Programmers Chapter 2. Fundamental Daty Types Timothy Budd.
Programmeren 1 6 september 2010 HOORCOLLEGE 2: INTERACTIE EN CONDITIES PROGRAMMEREN 1 6 SEPTEMBER 2009 Software Systems - Programming - Week.
JavaCompExt: Extracting Architectural Elements from Java Source Code N.Anquetil, J.-C. Royer, P. André, G. Ardourel, P. Hnětynka, T. Poch, D. Petraşcu,
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
Java – An Object Oriented Language CS 307 Lecture Notes Lecture Weeks 5-6 Khalid Siddiqui.
Java Basics. Tokens: 1.Keywords int test12 = 10, i; int TEst12 = 20; Int keyword is used to declare integer variables All Key words are lower case java.
 Data Type is a basic classification which identifies different types of data.  Data Types helps in: › Determining the possible values of a variable.
Computer Programming – Grammar – data types – Variables – Keywords – Operators – decision making – Loops – Arrays – Functions – files Programming Environment.
Chapter 6 Testing and running a solution. Errors X Three types Syntax Logic Run-time.
1 Scalar and composite data Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Scalar and composite data Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Harvard Mark I Howard Aiken was a pioneer in computing and a creator of conceptual design for IBM in the 1940s. He envisioned an electro-mechanical computing.
FHIR and Relational Databases
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
The Data Types and Data Structures
Chapter 6: Data Types Lectures # 10.
Java Review Hello..This ppt is to give you an introduction about java and why it is soo special The segments all discussed here are the crucial parts of.
Type Conversion, Constants, and the String Object
Introduction to Primitive Data types
Presents: Rally To Java Conversion Suite
Introduction to Primitive Data types
Presentation transcript:

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 Data ISAM tables Business logic BAL language User interface Character oriented Data Relational database Business logic Java language User interface Graphical Reverse engineering Restructuring Automated code transformation Information and models Migrated code

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

Variable declarations #ifdef A DCL a$ = 9 FIELD = M, a DCL b$ = 5 DCL c$ = 5 FIELD = M, b DCL d# DCL e# DCL f$ = 4 FIELD = M, c DCL g% FIELD = M #endif a bc def 1.Fields do not introduce any additional lexical scope. 2.Sizes may be incorrect (no compile time check). 3.The same layout in memory can be expressed in many different ways. g

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)

Square bracketing DCL a$ = 9 FIELD = M, a DCL b$ = 5 FIELD = M, b DCL d# DCL e# DCL f$ = 3 DCL c$ = 3 DCL a$ = 9 FIELD = M, a 9 [ ] DCL b$ = 5 FIELD = M, b 5 [ ] DCL d# DCL e# DCL f$ = 3 DCL c$ = 3

Folding declarations DCL a$ = 9 FIELD = M, a 9 [ ] DCL b$ = 5 FIELD = M, b 5 [ ] DCL d# DCL e# DCL f$ = 3 DCL c$ = 3 DCL a$ = 9 FIELD = M, a 4 [ DCL b$ = 5 ] FIELD = M, b 5 [ ] DCL d# DCL e# DCL f$ = 3 DCL c$ = 3 DCL a$ = 9 FIELD = M, a 4 [ DCL b$ = 5 ] FIELD = M, b 4 [ DCL d# ] DCL e# DCL f$ = 3 DCL c$ = 3 DCL a$ = 9 FIELD = M, a 4 [ DCL b$ = 5 ] FIELD = M, b 3 [ DCL d# DCL e# ] DCL f$ = 3 DCL c$ = 3 DCL a$ = 9 FIELD = M, a 4 [ DCL b$ = 5 ] FIELD = M, b 0 [ DCL d# DCL e# DCL f$ = 3 ] DCL c$ = 3

Folding redefinitions DCL a$ = 9 FIELD = M, a 4 [ DCL b$ = 5 ] FIELD = M, b 0 [ DCL d# DCL e# DCL f$ = 3 ] DCL c$ = 3 DCL a$ = 9 FIELD = M, a 4 [ DCL b$ = 5 FIELD = M, b 0 [ DCL d# DCL e# DCL f$ = 3 ] DCL c$ = 3

Iterating (fold declarations) DCL a$ = 9 FIELD = M, a 4 [ DCL b$ = 5 ] FIELD = M, b 0 [ DCL d# DCL e# DCL f$ = 3 ] DCL c$ = 3 DCL a$ = 9 FIELD = M, a 1 [ DCL b$ = 5 FIELD = M, b 0 [ DCL d# DCL e# DCL f$ = 3 ] DCL c$ = 3 ]

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

Square-angle bracketing DCL a$ = 9 FIELD = M, a 1 [ DCL b$ = 5 FIELD = M, b 0 [ DCL d# DCL e# DCL f$ = 3 ] DCL c$ = 3 ] FIELD = M, a 0 [ DCL g$ = 2 DCL h$ = 2 DCL i$ = 5 ] DCL a$ = 9 [< >] FIELD = M, a 1 [ DCL b$ = 5 [< >] DCL c$ = 3 ] FIELD = M, a 0 [ DCL g$ = 2 DCL h$ = 2 DCL i$ = 5 ] FIELD = M, b 0 [ DCL d# DCL e# DCL f$ = 3 ]

Move redefinitions DCL a$ = 9 [< FIELD = M, a 1 [ DCL b$ = 5 [< FIELD = M, b 0 [ DCL d# DCL e# DCL f$ = 3 ] >] DCL c$ = 3 ] FIELD = M, a 0 [ DCL g$ = 2 DCL h$ = 2 DCL i$ = 5 ] >] DCL a$ = 9 [< >] FIELD = M, a 1 [ DCL b$ = 5 [< >] DCL c$ = 3 ] FIELD = M, a 0 [ DCL g$ = 2 DCL h$ = 2 DCL i$ = 5 ] FIELD = M, b 0 [ DCL d# DCL e# DCL f$ = 3 ]

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