The VARLET Project  

Guided Tour for Varlet "Lancelot" 1.x

The purpose of this guided tour is to demonstrate some functionality of the Varlet database reengineering environment. The given example illustrates the evolutionary and interactive reengineering process supported by Varlet "Lancelot". Note, that this version does not consider the fuzzy analysis engine "Merlin". You will learn to 
  1. Start Varlet 
  2. Parse a legacy relational schema (SQL)
  3. Annotate the parsed legacy schema with some additional semantic information, e.g.,
    1. Annotate additional foreign key dependencies
    2. Toggle detail level
    3. Annotate alternativ keys
    4. Annotate inheritance hierarchies implemented as variant records
  4. Translate the relational schema into an object-oriented schema (initial transformation, perform some redesign operations)
    1. Rename generated properties
    2. Transform a class to an association
    3. Split a class
  5. Revisit the relational schema and correct the analysis results: remove an unused attribute
  6. Propagate changes into redesigned object-oriented schema (re-establish consistency)
    1. Update
    2. Look at Update report
    3. Redo: Split a class
Animated Guided Tour

Start Varlet 

You can invoke Varlet with the execution of 'StartVarlet' in the directory '$VARLET_DIR/bin'. The Varlet Control Panel 'VarletControl' will show up. 

 

You can start the different tools of the Varlet environment with this Control Panel. These tools are from left to right: 

  1. Parse SQL Schema
  2. Start Analyzer View
  3. Start Designer View
  4. Start GFRN View (this functionality is not included in Varlet "Lancelot")
  5. Load Varlet Project
  6. Save Varlet Project
  7. Remove Project
  8. Reset Varlet 
  9. Exit Varlet 

Parse GuidedTour.sql

At first, you have to parse a relational schema. You can invoke the Varlet SQL parser with the outer left button in the Varlet Control Panel. 

 

You get the 'select SQL-File' dialog. Here you have to select a file with the SQL schema you want to parse. For the guided tour you should select  'GuidedTour.sql'. 

 

Now Varlet will parse the selected SQL schema. 

Analyzer View

After parsing you can open the Analyzer View to see a viualization of the SQL schema. You do that with the second left button in the Control Panel. 

 

Now,  you get the Open View dialog. No view exists yet, so you have to enter a name for a new view, e.g. 'GuidedTour'. 
(Note, that you can create many different views on one single schema. This is extremely useful when you work on large schemas.) 

 

After you typed a name and selected 'OK' a new window with the Analyzer View will be opened automatically. 
The Analyzer View has a drop down menu bar. Moreover, you find some often used functions in a quick access bar. From the left to the right you find 

  1. Close View
  2. Print View
  3. Undo
  4. Redo
  5. Zoom In
  6. Zoom Out
  7. Scale In
  8. Scale Out
  9. Sugiyama Layout
  10. Springembedder Layout
  11. Update (this functionality is not included in Varlet "Lancelot")
Now you can see the graphical representation of the parsed SQL schema. Use the left mouse button to move tables to other positions. You can toggle the positions of ingoing edges (foreign keys) by klicking on the black triangles (grabs) or you can use the 'arrangeGrabs' command which can be invoked by pressing the right mouse button when the mouse cursor points at a table. 
In this example you see three tables. Between the tables 'Participants' and 'Person' exists a foreign key dependency. 

 

It is possible to add or modify the structured and semantic information of the relational schema. You have two ways to activate a command: 

  1. Select a command from the menu item 'Commands'. ( Here you get all existing commands.)
  2. After you selected any item in the schema, you can get a list of the commands which are still applicable to your selection, with the right mouse button. (This functionality is in development and might still be buggy.)
For example you can create a new foreign key dependency ( also called inclusion dependency) between the tables 'Participant' and 'Course'. 

Execute Command: CreateInd ( Lecturer Course, ProfNo Title)

First you have to select the 'CreateIND' command in the menu. Then you get the 'ExecuteCommand' dialog. Now you have to select 'Lecturer' and 'Course' in the table 'Participants' with the middle mouse button and drag them in the first parameter field (also with  the middle mouse button). Next you have to drag 'ProfNo' and 'Title' in the same way in the second parameter field. In the third parameter field you can enter a belief between 1 and 100 which represents the percentage that the created dependency is correct. (You can enter any integer value here, as Varlet 'Lancelot' does not consider fuzzy beliefs.) If you filled all three parameters, you can execute the command 'CreateInd' by pressing the green tick button. The button with the red cross cancels the command. 
Make sure that you select the attributes in the same order, because the order defines the correspondencies between foreign key and key attributes. In this case, 'Lecturer' references 'ProfNo' and 'Course' references 'Title'. 

 

The new inclusion dependency will be integrated in the Analyzer View after the execution of the command. 
 
 

Execute Command: SetInv_IND( )

You can also add some further semantic information about the dependency you have just inserted. For example, you can annotate the information that the relationship is total, i.e., that the foreign key implies inclusion dependencies in both directions. 
First select the inclusion dependency between 'Participants' and 'Course'. 

 

Drag the selected relationship in the left parameter field and a belief in the right parameter field. 

 

After execution of SetInv_IND you can have a look at the modified inclusion dependency between 'Participants' and 'Course' . 
The additional semantic information is represented by the equal signs in the black triangles. 

 
 

Execute Command: ToggleOnDetail

If you want to see a more detailed view on the represented dependencies, i.e., the correspondencies between attributes, you can execute the command 'ToggleOnDetail'. You must select the inclusion dependencies you want too see in detail , press the right mouse button and select 'ToggleDetailOnIND' . 
If you change to the high level detail, make sure that the grabs of the selected inclusion dependencies are on the left or right side of the table. (Otherwise, you will see a bug - sorry, we will fix it soon.) 

 

After successful execution you see the detailed information about the dependency between 'Participants' and 'Course': it is represented as a directed line between both participating tables, where the corresponding attributes are marked by numbers, e.g., 'Lecturer' (1) and 'ProfNo' (1)) 

 
 
 

Execute Command: SetUnique

The schema catalog of legacy database systems rarely contains information about alternative keys. Such information can be added by using the 'SetUnique' command. 

 

Finally, the modified relation Person has two alternative keys. 

 
 
 

Execute Command: Create Variants

In next step, you annotate the semantic information that table 'Person' comprises a hidden inheritance hierarchy that is represented by a variant record. At this, you will specify that each tuple in table 'Person' has either NULL value in attribute 'Term' or a NULL value in attribute 'Room'. 
Select the 'Create_Variant' command from the command menu in the menu bar. You have to select all attributes in the relation 'Person' which should belong to the first variant. So you have to select Name, Street, Room, City, Zip, Tel, No, Birthday and drag them to the first parameter field. In the second parameter field you have to enter a belief between 1 and 100  as mentioned above. 

 

Now Analyzer View shows that table 'Person' has two variants. Currently, you see the second variant of relation Person. Next, select Person, press right mouse button and execute 'Show_Next_Variant' . 

 

 

You still have to create the second variant of table person. Call 'Create_Variant' once again, select the attributes Name, Street, City, Zip, Term, Tel, No, Birthday, drag in the first parameter field an press the green tick button. 

 

Now, the Analyzer View indicates three variants of table 'Person'. However, in this example you know that there is no tuple in table 'Person' that has none-NULL values in all attributes. Consequently, you have to delete this variant. Execute 'Show_Next_Variant' followed by 'Delete_Variant' to do this. 

 

Deleting the first variant implicates that Person now has two variants. 

 

Now, let's assume you annotated all semantic information known about the relational schema and you want to create an object-oriented translation. Please close the Analyzer View, first. 
 

Designer View

After closing the Analyzer View you can open the Designer View by pressing the third button on the Varlet Control Panel. 

 

Again, you have to enter a name for the view to be created, e.g., 'GuidedTourOO'. 
Now, an initial translation of the existing relational schema into the object-oriented model is automatically performed. 

 

After this translation you will see 5 classes: Person, Person#1, Person#2, Course and Participants in an OMT-like notation. 

Rename Professor and Student

The variant table 'Person' has been mapped to an inheritance hierarchy. The name of the superclass 'Person' is set in white font to indicate an abstract class. You can assign more reasonable names for its two concrete subclasses 'Person#1' and 'Person#2' by executing the command 'Rename'. 
Rename 'Person#1' to 'Professor', because we assume that the class Professor represents a person without attribute 'Term'. 
Select 'Person#1' with the middle mouse button and drag it in the parameter field. 

 

Next, rename 'Person#2' to 'Student', because we assume that the class student represents a person without attribute 'Room'. 

 
 

Execute Command: ClassToAssoc ( Participants )

Next, try to execute an example for a redesign transformation. 'ClassToAssoc' transforms a class with two one-to-many relationships and without attributes into a many-to-many relationship. (Note, that this class does not have any attributes, because borrowed foreign key attributes are no longer needed in the object-oriented data model.) 

 

You see the Designer View after successful execution of 'ClassToAssoc' . 

 
 

Execute Command: SplitClass( Tel  Zip  Street  City,  Address)

Another example for a redesign transformation is 'SplitClass': you may want to aggregate attributes 'Tel','Zip','Street', and 'City' into a new class called 'Address'. 
To do this, select command 'SplitClass' and drag these attributes of table 'Person' to the left parameter field. In the right field you have to enter the name for the new class ('Address' may be a good choice). 

Execute the command with pressing the green tick button. 
After execution the Designer View shows a new class 'Address' and an association between 'Person' and 'Address'. 

 

Now, close the Designer View by pressing the left quit button in the quick access bar. 

Analyzer View

Now we want to demonstrate a simple example for an iteration in the schema reverse engineering process. Let us assume that by investigating the embedded SQL source code of our sample application you learn that attribute 'City' of table person is not used at all. You might want to add this information about the relational schema. 
Use the Varlet Control Panel to reopen the Analyzer View. 

Execute Command: Remove( City)

You have to select the attribute 'City' in the relation 'Person'. Next you have to the right mouse button to execute the remove command. 

 

After successful execution, the attribute is removed from the relation 'Person'. 

 

Now, leave the Analyzer View by pressing the Exit button in the quick access bar. 

Designer View

After each modification of the analysis information about the relational schema, consistency with the redesigned object-oriented model has been lost. However, Varlet facilitates to re-establish this consistency. Please open the Designer View again. Now you have to update the oo representation in the Designer View by pressing the 'Update' button in the quick access bar. 

 

The update operation incrementally re-establishes the consistency, i.e., it preserves as much of your redesign work as possible. However, in some cases the update operation has to undo some redesign transformations because their corresponding preconditions are no longer valid. In this case, the update operation has undone the redesign transformation 'SplitClass', because the 'City' attribute in its parameter list is not longer existent. You can get a report about all undone redesign transformations by viewing selecting the drop down menu Options->Update Report->View to open UpdateReport window. 

 

The UpdateReport shows that you have to redo SplitClass (Zip  Street  Tel,  Address). 
So, select the SplitClass command and drag the attributes 'Zip', 'Street', 'Tel' in the first parameter field, enter the new class name Address in the second parameter field and press green tick button to invoke the 'SplitClass' command. 

 

The first button from the right side is 'DeleteMapping'. ( Is not on the scrennshot.) 
If you press it, all mapping and redesign informations will be deleted. So, be careful using it! 
If you really want to start over again with the object-oriented schema automatically translated from the relational schema: press 'DeleteMapping' and then 'Update'. 

Congratulation, you survived the Varlet 'Lancelot' Guided Tour ! 

    GOOD BYE.  We would like to here from YOU. 

Please contact the Varlet group for additional information.

Documents
People
Guided Tour
Links
Download

News
FAQs
To Do
Private

Home

 

 

 
[Documents] [People] [Guided Tour] [Links] [Download]
[News] [FAQs] [To Do] [Private] [Home]