Database Metadata

January 30, 2012

"Table Builder" window

"Table Builder" window

The image shows a new browser called “TableBuilder”.

At the top-left, is a panel showing the accessible MySql databases and below it is a panel which shows the tables defined within the selected database. The large panel in the center shows field information for the selected table.

At the moment, there are only two databases visible without a login account:
— simpl (which contains all of the SIMPL objects)
— demo (tables for use in demos)

This browser will be used for generating ExtJs specifications from database metadata.

In particular:
— field definitions for data stores
— column definitions for grids
— data validation functions
— table relationships for SQL queries

The goal is to automate the most tedious and error-prone tasks of creating a use interface.

And all the more important the larger the project.

Generated Application - "Demo 2"

Generated Application - "Demo 2"

Generated App – “Demo 2

This is a very simple application – just a set of styled containers using the custom CSS (generated by the CssFactory class) and some custom JavaScript (generated by the JavaScriptFactory class) for handling the selection tabs.

However, it has been built using the complete CodeIgniter/PHP framework with a newly generated default controller and view. It is deployed on an Amazon AWS/EC2 webserver.

The application is built using the “Demo2” class which generates all of the customized CSS, JavaScript, and ExtJs definition files.

I did a small experiment to see how long it took me to generate the application from a clean start. Here are the steps:

1) Use “FileBrowser” to clone the CodeIgniter libraries to the deployment directory.

2) Use AppBuilder to set the default controller name, set the default view name, “initialize” the app to use ExtJs, and set the code generator class.

3) Generate the custom code and build the required PHP files.

4) Done – the app is deployed.

Total time was about 53 seconds.

Of course more complicated apps will take a bit longer and, of course, there was the time to build the “Demo2” class itself.

But as the libraries get more comprehensive, creating a new application which is similar to something already existing in the library (by subclassing existing classes) will become very quick.

The created application is vanilla CodeIgniter-PHP-CSS-JavaScript-ExtJs – none of the SIMPL libraries are used in the deployed app.

If you look at the source code for the demo, you will see this meta-tag near the top:

The square brackets will hold an identifier of the SIMPL class generator used to build the application. This will be used for application maintenance in the future.