Posts tagged code-generation

Model-Driven Code Generation Process

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.

model-driven code generation process

The model-driven generator (MDG) transforms your model into code using a template of some kind. Here it outputs C# code that can be compiled into an assembly using a c#-compiler. You also will need some framework or platform to run your code.

The hard part is creating a good model.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Sex and Drugs and Software Architecture

Yeah, right. Software Architecture not only sounds boring, in fact it is boring.

Software Architecture is all about structure. The more structure the better. That makes software architecture boring. (Not for me, I like creating structure)

But is structure always necessary? Maybe not. Sometimes, a monolithic application without extensive structuring will do just fine.

If you are not from under a rock, you probably know what is a layered architecture. Nowadays it seems that everyone wants a layered software architecture, it is a must have. But do they know why? The people who want the layered architecture most are not able to explain why they prefer  a layered structure.

And do you need a layered architecture when the code is generated from a model?

I am not sure. You can start simple and reuse the same model as the generation process evolves and generate a full blown loosely coupled layered application.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

The Search-Engine Pattern

imageThe Search-Engine pattern is a simple, but powerful pattern. The user provides some sort of search phrase and the search engine returns all matches found in a data store. Next, the user browses the results to select the one she is looking for. When selected details are shown. This is exactly how Google (and other search engines) works.Datamodel

This pattern is also very useful for maintenance of simple data normally found in an information system. 

To apply this pattern to entities under maintenance, they have to fulfill some criteria. The entity must be:

  1. searchable
  2. able to return displayable results
  3. identified by a unique key

The entities in the model shown right fulfill these criteria. They all have a unique identifier. They are searchable through their name, which is also used for displaying in the search results.

When looking in more detail, the entities in the simplified model look very similar. This makes them excellent candidates for a generic code-generated maintenance solution.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)