Saturday, January 24, 2009

C++/Many other languages: API Generator

The APIGen code generator prepares well written, ready to compile or interpret source code for many combinations of Attachmate API's, programming languages, and host terminal types. It is used internally at Attachmate by employees in Sales, Support, Quality Engineering, and Development. It has also been passed on to a few customers.
I conceived and designed it, and then implemented approximately 25 of the 30 generator classes now available.
The base classes of the large inheritance tree seen below, were designed to serve in a translation object server so other contributors (or students) could develop the generator for the remaining (over 200) combinations of API, host, and language. That is, it provides a means for other contributors to snap-in translation modules that rely on the base classes for the API's and languages that concern their field of expertise.  I feel funny bragging here about such a complex inheritance tree, especially in light of the software engineering best practice advice, "favor aggregation over inheritance", but the MS Visual Studio I used at the time provided a Visio modeling link that made code architecture and generation very easy and I wanted to exercise that approach.
Having finished the first 25 generators I have since endeavored to romance the coding of the remaining 200 with members of Attachmate's Developer Support and Sales Engineering teams.

Initial screen where user specifies choice of API and programming language.

Optional screen where controls allow user to specify function parameters.

Output screen shows generated source.

The UML class diagram below, recorded early in the project and not showing all generator classes, shows inheritance relationships in APIGen for the twenty-two Attachmate API's.

Each leaf level class symbol represents one combination of API, output language, and terminal type.

No comments:

Post a Comment