Agile & Lean Management

Refactoring the Software Development Process

Browsing Posts in Code Generation

Template-based code generation in fact is pretty easy. It very much resembles ordinary mail merge. You create some (sophisticated) template, fill in all the black holes with metadata from the model, and voila! All code is generated automagically. A happy ending. But no, often that is not the case. The pain is always in the [...]

After Generating Database Objects from an UML Model you are desperately in need of a data access layer (DAL) and a business logic layer (BLL). Today we are going to generate the famous Business Entities. After executing that funny sql-script we generated from UML previously, you are the proud owner of a database. Since I [...]

In this mini-series of one post, I’ll show you how to generate SQL-script from an UML model. First, you need a model. This can be any model, but here I use an UML model. The class diagram on the left shows a simple model consisting of a parent class and a related child class. Both [...]

Remember my factory method design pattern example to compute the first name and last name from a full name? No? It’s really easy. You only have to provide a full name, like “John Doe” or “Doe, John” and the business logic computes the correct first name and last name. This time we are not interested [...]

The model-driven code generation process is really simple. You create a model, for example using UML. Next, you feed a hungry generator with your model in a format it can digest. That could be XMI. The model-driven generator (MDG) transforms your model into code using a template of some kind. Here it outputs C# code [...]

Did you ever used Eclipse? Never? Then, now is the time! Lets generate some crap… So, first we need Eclipse. Next, install the open-source modeling tool Topcased and code generator Acceleo into Eclipse. Next, spend a couple of hours in finding out how it all should work together.(To be honest, it didn’t take hours but [...]

Now it is time to generate some business entities from a model. Suppose we have a simplified model with just one entity called Course. It has an unique identifier CourseID and a searchable and displayable attribute called CourseName. To generate source code the model is injected into the following template. The resulting generated code will [...]