1.1 UML class diagram
UML allows to graphically describe classes and their relationships using class diagrams. Generally, class is represented as a named box enclosing a list of class attributes and class methods. Class relationships are represented by lines between class boxes. A relationship includes associations and generalizations. Generalizations describe class hierarchy, and associations describe the ways classes use each other: for example, object reference or aggregation. Associations have two named "roles" on each end of the line. Roles naturally describe the roles that the classes play in an interclass relationship. There are many other details of information which can be depicted on the class diagram, you can refer to the official UML documentation.
1.2 Text generation
What is important for us, class diagram provides enough information to construct a source code for class declaration. For a complete class definition (implementation), the class diagram doesn't have the behavioral information while it is still possible to construct empty shells for class methods. It can be done manually, but it also can be conveniently done by a special program generating the code automatically - a source code generator. Even if the programmer has to spend some time to manually fulfill the functional logic, the generator work significantly reduces the amount of time to achieve the final result. Also, it reduces the possibility of program errors.
There are two general approaches in text generation - hardcoded generators and template generators.
1.2.1 Hardcoded templates are usually implemented using standard programming languages like C++ or Pascal. Such an approach gives full control over the generation process. Generally, it is also the fastest way to generate the text. But coding of the generator can be very challenging because text structure is submerged in language constructions like string concatenation, assignments, etc. If the generator has to be implemented only once, it is probably not a big problem. But if generators have to be created and modified on a regular basis, the hardcoded approach can be painful. In real life, we always have changing requirements obligated by programming language, style of coding, frameworks used for software developments, ...
1.2.2 The opposite approach is to use templates. A template is a text file resembling the required output text. It includes some fields filed by the generator using information from the UML class model. In other words, the generator is fed from two sources - data structure (UML model) and text structure (template file). Templates show text structure naturally, but it is difficult to use advanced control structures like loops and condition generation with templates.
So, it would be nice to have an approach flexible enough to control the generation process and easily describe the format of the desired output text. TEAL language has been designed to fit such a desire.
First of all, the result of the TEAL program execution is a text. The second, programmer doesn't access the result explicitly, the resulting text is fulfilled implicitly as each element os language is executed. It is possible because the majority of language elements are "values". Values add new portions of text to the result. Such implicit result production allows to make the structure of the TEAL program more readable from the perspective of output text format.
We will know more about TEAL syntax later. But now we have to realize that TEAL was designed to generate any kind of text based on any kind of input data, not necessarile the UML class model.
1.3 Object-to-database mapping Most of business applications deal with "persistent" classes, where each class instance or object exists in both the dynamic memory assigned for a process and some persistent storage like a file. It allows the program to be restarted and continue to operate with exactly the same data it dealt with before it was stopped. In majority of cases, instead of plain files, relation databases are used for persistent object storage. It means that objects are represented by two parallel structures - classes and database tables. As we already discussed, class structure is described easily by UML class diagrams. Unfortunately, UML notation has nothing to depict the relation between classes and underlying database table structures. But it would be nice to generate a source code already enriched with database mapping. To do so, class-to-database mapping repository of some sort has to be presented at time of generation.
1.4 DbUML suite was designed and developed as a flexible tool allowing loading an UML class model information, optional database mapping and source code generation using compiled TEAL templates.