The Data Dictionary
[Previous] [Main] [Next]

The Data Dictionary

The JGuiGen Data Dictionary is a table that you add to your database. This table has two major purposes. First it becomes documentation for your tables. Second, it becomes the base from which JGuiGen generates code to view, edit, add and delete rows into your tables. A third (less important) use is to compare what the table schema "should be" with what the table schema actually is. This can be important when you have the databases with the same schema at several different remote sites. You can use the report generated by JGuiGen to see if the schema of these remote tables match the schema of the master table.

The Data Dictionary Process

1. You add the Data Dictionary table to your database. You can run provided SQL scripts and java files to insert data into the Data Dictionary. Since the Data Dictionary contains data describing each column of each table, we have provided information describing the Data DIctionary table. the I18N table and the demonstartion UserLogData table. You will need to add this table in order for the provided UserDemo class to run. The I18N table contains the prompts and the codes bank for internationalizing JGuiGen applications and handling complex visual components like comboboxes, radio buttons and multiple-selected combo boxes. The readme.html file goes over creating and filling these tables in detail.

2. You can create either a c:\JGuiGen folder or a \usr\local\JGuiGen folder and place the provided JGuiGenINI.xml file in it. If you don't, the system will use the file in the folder where the application is running. The advantage of having a local copy is to make options available to some users and not others.

3. You edit the provided JGuiGenINI.xml file and fill in the JDBC driver, the type of database, the location of your database, the account and password that JGuiGen should use to access the database. NOTE: See the README.HTML file for information on how to remove the database username and password from this XML file and handle this with encrypted files and LDAP access. You will also need to fill in the package name that JGuiGen should use. This determines what folder JGuiGen writes java files to. All other files will be written to the folder you created in step 2.

4. You run the DataDictionary application click on CREATE. If you want to include several new tables in your data dictionary click on REFRESH and you will see a screen called MARK TABLES. This shows you a list of all of the tables that JGuiGen could find in your database. (Note I am presuming that the user name given to JGuiGen for attaching to the database defaults to the particular database you want the users to use.) Each table has its own screen. Click on rows in the scrolling table at the bottom of the screen and you can see information about each table. There is a check mark that you use to indicate which of the tables you wish to "Process" for the Data Dictionary. Once you have told the system which tables to process it will process you SQL database when you exist the MARK TABLE screen This will attempt to open your database and obtain metadata about each table you marked. It uses this data to fill the DataDictionary table. The table name, table column, data type, data precision, default value, nullable status and more is saved for each colum in each of the tables.

5. You can look at the HTML printout that was generated to describe your tables. The first run leaves quite a bit to be desired since there is nothing except the column names to tell you what the columns are used for. Click on Files --> View Data Dict. Listing to see the output of the run.

6. You click on CREATE --> CLASS to edit information about the classes you will generate and CREATE --> Column to edit information about individual columns in a table. Once you have opened the screen, the GUI will fill with information about the table you chose. You can add additional information describing this table. Choose a column name from the scrolling list at the bottom of the screen and you will see information about the column name you chose. You can enter information describing what this column is used for (this becomes a tooltip), how it is filled (by the system, by a user using a GUI, automatically by an auto-increment system, etc.) There are a number of other things you can enter to describe each field. these will be covered more later.

7. Rerun the Create --> REFRESH option again. The new HTML printout will contain the descriptions and notes you just provided. This is a much better set of documentation to describe your tables. In addition the system lists NEW columns, CHANGED columns (i.e. from char (30) to varchar(120) ) and DELETED columns.

8. Now you can use the data in the DataDictionary to generate the applications that will edit each of the tables.

Before we describe this process, lets look at the features of the JPanels that will be created.