The easiest way to understand how er2code works, is to start by looking at the problem of generating database wrappers.
Introduction
The focus of this project is to take some of the boring work of off the programmers shoulders. Writing database wrappers is boring and tedious, and as such can be the course of many "sleeping-while-typing" errors.
But on the bright side, boring and tedious often means that the process can be automated, hence this tool.
The main idea of er2code is that each relation (also called table by some people) in the database, is mapped to a class of the same name. This class then contains a number of methods for manipulating the attributes contained in the relation.
The approach taken by er2code is to have a long list of methods (these are called Function in er2code), these functions have some requirements regarding an attribute that must be satisfied in order for the code of the function to generated.
The code of the function contains plain text mixed with identifiers. Each of these identifiers can generate their "value" (a text string) based on the specific attribute they are applied on.
Of course it is not as simple as that, we haven't considered constructs, how to delete rows in the table, and how to handle foreign relations, e.g. 1-to-many.