![]() |
Guided Tour for Varlet "Lancelot" 1.xThe 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
Start VarletYou 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:
Parse GuidedTour.sqlAt 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 ViewAfter 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'.
After you typed a name and selected 'OK' a new window with the Analyzer
View will be opened automatically.
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:
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' .
Execute Command: ToggleOnDetailIf 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: SetUniqueThe 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 VariantsIn 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 ViewAfter 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'.
After this translation you will see 5 classes: Person, Person#1, Person#2, Course and Participants in an OMT-like notation. Rename Professor and StudentThe 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). |
|
|
||
|
|
||