Who on earth is HuGo?

Aus Hugo Doku

Wechseln zu: Navigation, Suche

HuGo is a framework for writing individual source code or text generators quickly.

1.1. What does a generator do?

A generator produces source code or text instead of writing this parts manually.

The parts that a generator produces are schematic text / source code, which you typically create per copy-paste-replace actions when you write this parts manually.

This schematic text is placed within templates, where the variable parts can be influcenced later from that person, who uses the generator. The one, who writes the generator is called domain engineer; the one, who uses the generator to build the concrete application is called application engineer. Normally the application engineer writes a kind of model, which holds the parameters for the generator. You can consider the model as the specification of the concrete application which is based on a schematic framework. This specification is written in a domain specific language (DSL), which is designed to the optimal use for the application engineer.

At HuGo the templates are called 'frames', because HuGo works as a frame processor (spoken to informatic people).

The following figure shows the roles when developing software using an individual generator:

BasicPrinziple_SW_Gen.jpg

Systems like HuGo enable you to write templates / frames and then build generators executables out of that.

1.2. Motivation of using HuGo

The motivation of a generator is in principle the automation of the software writing process.

Automation in principle has the following advantages instead of a manual process:

* Increasing quality by avoiding oversights (copy-paste- forgotten replace).
* Increasing quality because of schematic software design (a schema is the precondition for generating)
* Increasing the time to application
* Reducing cost because of higher quality and faster time to application

The motivation of writing an individual generators instead of using a closed tool is

* Increasing usability.
The model has a domain specific language, that is geared to the application engineers and their own domain language.
* Optimized usage of resources.
Because you write the template code, you determine how the generated codes looks like and which resources (e.g. memory) are used.
* Cost effectiveness.
A common tool must mainly be adapted to your needs. It could be more convenient to write your own generator than using a adopted tool.

The motivation of using the HuGo generator framework

* HuGo uses a Java Meta Language.
The meta language is a language which is set on base of Java, i.e. it extends the java language. When the generator is built, there is first a transformation to java code classes before javac compiles this classes to java executable code (for details please refer to section 2.1. HuGo Frame Builder). For the domain engineer this leads to an easy to learn language, which has always the full Java language range, e.g. object oriented, hash maps and all the current used Java provides.
* Generators are runable on multi plattform.
Because the build generators are Java executables, they run on all plattforms which support Java.
* XML as syntax for parameter language.
XML is a widely spreaded format. It has the advantage, that the tag-names are not fixed, thus you can choose them domain specific, but that many systems and tools support XML, thus data exchange is possible.
* Any target language possible
The target "code" in the Frames can be of any target language. Because on the point of view of HuGo the code is only text, i.e. source code text. Thus HuGo just prints the parameterized text with corresponding values. The compilation of the code is a step after the generating process.
* HuGo supports a process, including different parts of generating
There is a GPL License of HuGo.

1.3. Limitation

This section is about, what HuGo is not.

* No Click and Draw Tool, but effective text tool
HuGo is not a tool where you can build your generator using only mouse clicks. This is in the nature of HuGo. With HuGo you determine, which code will be generated by writing the templated Frames. HuGo can therefore be considered as a 'low level' tool like a programming language (e.g. C++); HuGo enables a lot of possiblities to write effective generators. It is up to the domain engineers to make their generators as much usable to their specific application engineers as possible, e.g. by using a convenient DSL (domain specific language) perhaps realised as special editors using flow charts, forms or what ever.
With HuGo you have a lot of freedom in writing generators. But having a lot of freedom automatically means having freedom in writing as well uneffective generated code. It is the same as C++. It is not the language, which writes unreadable code, but the developer which use C++ to construct software you better won't create thislike.Thus HuGo is a tool for developers who know about well structured code and just want to automate the creation of such well structured code.


Next: 2. Support