Home News (12/11/08)new Start Here Getting Started Downloads Documentation Tutorials (12/07/08)new Tablets Structure Deployment Web Studio OpenL Basics Constrainernew Change Log References LGPL License Motivational Reading OpenL Apologia |
Table of Contents
OpenL Tablets Structure and SemanticsAlso see Decision Tables , TutorialData TablesData Tables provide the ability to enter Java objects in relational format by simply using Excel spreadsheets. It is very intuitive and simple. Each table becomes an array of java objects available to the application through standard Java Bean getter method.
For example, this table contains 4 instances of a class As you can see the structure of the table is somewhat similar to the structure of the Decision Table.
The first row contains Data Table Header. It has a keyword
The second row contains Column Headers. They correspond to the Java programmatic names of the Java Bean
attributes of the class The third row contains Column Display Names. These are human-readable descriptions of the Columns. Using Excel Data Group/Ungroup feature you can hide first two rows and present the table to the business user in the following form:
Object GraphsThe unique feature of Data Tables is it's ability to create complete Java object graphs in compile-time. There are two different ways to do it: using either foreign keys or using object aggregation.Foreign KeysJava objects can be cross-referenced in Data Tables using familiar to every programmer foreign keys. Foreign key points to other table primary key, and OpenL Tablets binds it to the Object reference. The following picture demonstrates this process, and as always to get more details we refer you to the OpenL Tablets Tutorial
Aggregation
This approach should be used when Java object "owns" it's reference, for example class
Fake Primary Keys(since 5.1.1)This feature comes handy when you create a table based on Java class that does not have a suitable primary key field, but needs to be referred from another table through the foreign key mechanism.In this case you use fake primary key _PK_. The data that you enter for this column will be interpreted as String, the only "limitation" is that it must be unique and match the corresponding value in the foreign key column of the second table.SummaryThe Data Tablets can be viewed as a way of having a compact read-only database with data stored in Excel tables. It can be used for any kind of application data like reference data or storing test case data. The Data Tablets provide automatic binding of foreign keys to link data objects from different tables and ability to enter aggregate data objects (objects made of other objects) within a single table. And you don't have to write a single line of code to make this data available to your application!!!Also see Decision Tables , Tutorial |