Skip to content

Posts from the ‘MDA’ Category

19
Sep

Microsoft excited about modeling

Microsoft seem to be quite excited about modeling these days. Just recently, they announced that they have joined the OMG. OMG does NOT stand for Old Modeling Guys, but for Object Management Group. This is the standards body that brought you specifications like CORBA, UML, MDA and BPMN, to name just a few.

But Microsoft does not just talk about modeling, they also put their money where their mouth is: during the last few years, a number of people including Steve Cook and Stuart Kent have been working on a toolchain which first has seen the light of day under the somewhat cryptic name VSX DSL Tools.

VSXDSL Tools are really good at rapidly creating (simple) graphical modeling tools. However, when it came to model transformations and code generation, you were stuck with a somewhat dated technology called T4 (Text Templating Transformation Toolkit) - a template language quite similar to JSP and ASP. T4 seriously lacks some important features, like polymorphic dispatch, support for multiple file output and - believe it or not - a decent editor. Well, you can get one from http://www.t4editor.net/, but who likes to shell out 99 dollars for just an editor?

Now, Microsoft seem to have listened to their users and are coming up with an updated and extended version of the DSL Tools, code-named Oslo.

So what is Oslo? Douglas Purdy states that Oslo is:

  • A tool that helps people define and interact with models in a rich and visual manner
  • A language that helps people create and use textual domain-specific languages and data models
  • A relational repository that makes models available to both tools and platform components Looks to me like they are addressing all the issues MS DSL tools had.

At PDC 2008, the team will reveal Oslo and all its nice features.

Although I am an Eclipse fan and an openArchitectureWare committer, I am quite thrilled so see Microsoft make this move to embrace modeling. In my opinion, this will advance MDSD and DSLs quite a deal. A lot of people who may have never heard of DSLs and MDSD will now get in touch with those techniques due to the sheer marketing power of Microsoft. This will also bring some nice competition to the market, which always is a Good Thing (tm).

The press release states that "to make model-driven development a reality, Microsoft is focused on providing a model-driven platform and visual modeling tools [...]" - So, welcome to the modeling world, Microsoft!

Fork me on GitHub
5
Aug

Some thoughts on the merits of model driven software development

Scanning my RSS feeds today, I came across this post by Magnus Jungsbluth in which he deals with the question "Is Model Driven Development Faster?". As Magnus points out, the question whether you can be faster by using model driven development points in a wrong direction. Just being faster is not a major goal of model driven development. It's the quality that counts. Model driven development helps you to concentrate on the relevant parts of your software (i.e. the business logic) instead of having to care too much about the architectural plumbing around the business logic. Yes, using a code generator saves you some time. Precious time you will be able to invest into other parts of the software you build. This will amount to a higher quality of your software. Magnus mentions some more prejudices people have towards model driven software development. Here are a few:

"Higher level of abstraction = more complicated"

Now, this is plain wrong. Model driven approaches do not aim at making things more complicated. They aim at making things simpler and easier to achieve. This is what we mean by "raising the level of abstraction". I guess it's the word "abstract" which makes most people think things become more complicated. Wikipedia states that "Abstraction is the process or result of generalization by reducing the information content of a concept or an observable phenomenon, typically in order to retain only information which is relevant for a particular purpose." This definition makes clear that abstraction helps to simplify things in order to concentrate on only the relevant parts.

Consider a subway map: it is an abstraction of a geographical map, leaving out all the superfluous information, just retaining what is needed to find your way in the underground. The subway map is a domain specific map, explicitly aimed at a special purpose. If you need to find your way by car, you'd need a different kind of map.

Subway map

Abstraction in the context of model driven software development means to leave out the superfluous details and concentrate on the relevant parts. Let me give you an example: If you are writing  a software for your HR department, you really shouldn't need to care about writing getters and setters and how exactly to write that m:n relationship mapping in hibernate. Instead, you should concentrate on the names and types of the attributes and the fact that a certain relationship indeed is an m:n relationship.

"MDSD / DSLs enable business users to write software"

... do business users (i.e. the people who are going to be using your software) want to write software on their own at all? I don't think so. Modern business live is organized by division of labour, which is a good thing because it allows us to do the things we're good at and specialize ourselves.

Although I don't think business users should programm their own software using MDSD or DSLs, I believe that using MDSD and DSLs will help to bridge the gap between developers and business users. Much is gained if a developer and a business user can look at a graphical or textual model and discuss the business requirements in  language both understand. It is the task of software architects to ensure that the models being used can be written in this very domain specific language.

Oh, and please resist the temptation to provide a graphical language that tries to mirror a textual DSL one-to-one. Graphical syntaxes and textual syntaxes are very different. Things that can very easily be expressed in a graphical language  might look very awkward when mapped to a textual language and vice versa. Don't get me wrong - there's nothing evil about using different concrete syntaxes to provide views on one common / shared model. However, graphical languages are better suited to provide an overview of a system or module, whereas textual languages are better suited to flesh out the details.

"Versioning is tough, DSLs do not support versioning"

While it certainly is true that traditional UML tools are not that well suited for collaborative work (much due to the fact that most tools store their models either in a proprietary format or in monster XMI files), this is not true for external textual DSLs.

When using a textual external DSL, your model is plain text. Thus, your models can now be very easily stored in a version control system such as Subversion or CVS. And of course they can be diffed and merged. Using textual DSLs feels very "natural" to programmers after all.

Conclusion

So, to sum up: model driven development is neither some kind of obscure art which takes you years to learn and understand. Nor does it make things more complicated. It aims at aking your life easier. It does not neccesarily save you time, but it will help you to better use your time to build better software. One of the reasons your software will be better than before is that your business users will be able to discuss with you using a language you both understand.

That's what model driven software development is about.

22
Jul

Call for Papers / Participation: MDSD Today 08

From October 15th - 17th, the second workshop on model driven software development "MDSD Today" will take place in Elmshorn near Hamburg, Germany.

The goal of this conference is to provide a platform for professionals (managers, architects and engineers alike) in the field of model driven software development to meet and exchange ideas.

The three day will be organized into the following major blocks:

  1. Management Day
  2. Research Papers and Industrial Reports
  3. MDSD Tutorials

The management day will feature keynotes by Dr. Axel Uhl (Chief Development Architect with SAP) and Ed Merks (of Eclipse Modeling fame).

Tutorials on various MDSD-related topics (such as model-to-model transformations, model-to-text transformations, external textual DSLs) will be delivered by members of the Eclipse Modeling Project on day 2 and day 3 of the conference.

If you use model driven software development in your daily work, please consider giving a presentation.

If you do not use MDSD and would like to hear about other's experiences, you should consider participating in the conference and take the chance to attend the MDSD tutorials. At EUR 350 for three days, that's a real bargain.

The CfPs and more information on the conference can be found here (english) and here (german).

Hope to see you there!

27
Jun

How to distinguish generated code from non-generated code

It is a well-known fact that for most real-life applications, you canot use full code generation - some bits have to implemented in the source, not in the model. I sometimes find it funny to hear us software developers talk about business logic. If the business logic really would be logical in a mathematical sense, we'd be able to do full code generation. Alas, it is not, thus we are required to write some source code.

Over the last years, quite a number of patterns have evolved for integrating generated and non-generated code. Some of them are protected regions, generation gap, recipe frameworks, particial classes and annotated models.

In this post, I want to concentrate on protected regions and the generation gap pattern, as these two have turned out to be used most often in model driven software development.

The question is, how do you distinguish generated code from non-generated code. Looking at average enterprise / JEE applications, one can see that the amount of generated code is much larger than the amount of manually crafted code. The developers working on your projects need to quickly be able to navigate to the places in the source code where they may insert hand crafted code.

Here are two things you can do.

Use Eclipse Color Decorators
If you use the generation gap pattern (illustrated below), you should set aside a source directory for all generated code, e.g. src-gen. Hand-crafted code (particularly the classes derived from the generated base classes) go to the src directory as usual.

The Generation Gap Pattern

Since all generated code is generated by your code generator, there is no need to check in generated code. You only have to version your model and the manually crafted code. To ensure developers do not accidentally check in generated code, you should add the src-gen directory to your .cvsignore (or .svnignore) file. Having the ignore file, you can now turn on Eclipse color decorators, which is the corner stone of this tip. Here's how:

  1. Open the preference dialog (Window > Preferences)
  2. Navigate to Team > CVS > Label Decorations
  3. Tick the Enable font and color decorations checkmark
  4. Navigate to General > Appearance > Colors and Fonts by clicking on the Colors and Fonts hyperlink below the check box
  5. In this dialog, change the color for Ignored Resource (Foreground) to silver or light gray

As a result, all ignored resource will appear in light gray (or any other color you might have chosen):
Decorating generated code files

Use MINT
If you use protected regions, you need a way to decorate the parts in your code that won't be touched by the generator. The Eclipse Modeling Framework Technology project (EMFT) has a subcomponent which was written with this in mind - MINT.
Using MINT, you can highlight the parts of the source code which have been changed by you:
Highlighting handcrafted code with MINT

18
Sep

openArchitectureWare 4.2 released

The openArchitectureWare team has released version 4.2 of the well-known MDSD toolkit.

The new version comes with several major improvements (see below) and is now also fully compatible with the Eclipse 3.3 Europa release and the corresponding EMF 2.3, UML 2.1 and GMF 2.0.

Major new features are:

  •  A Debugger for Xpand and Xtend
  • Product Line Engineering (using XWeave and Xvar)
  • Textual DSLs with Xtext
  • Hyperlink navigation in many editors
  • Refactoring for Xpand templates
  • A totally reworked documentation, available as PDF and Eclipse online help
  • 3hrs of videos available demonstrating the use of simple to complex features
  • Many bugfixes
  • Improved overall performance

See the New And Noteworthy for details.

openArchitectureWare can be downloaded from the Eclipse website.

4
Jan

Leaving Lufthansa Systems

I am leaving Lufthansa Systems to join Gentleware.

I joined Lufthansa in August 1996, when I started my studies in computer sciences at Nordakademie, Elmshorn. After finishing my studies in early 2000, I started my career as a software engineer with Lufthansa Systems. My first team developed a tool that helped administrators to install Windows PCs unattended. Most of the code was written in Delphi and DOS Batch. After 1 year, I had the opportunity to join another team who were writing enterprise applications in Java. Although I had never written a single line of Java code before, I was given the chance to join the team (mostly because I had some experience with distributed systems and CORBA). The team was rather small when I joined (only three developers, including me, and one boss), but grew up to 15 developers in about 2 years. We had some good fun writing J2EE applications (and frameworks).

In 2004, I was looking for a tool thet helped me to quickly create a Struts-based application and came across AndroMDA. This was an important step on my way into the world of model driven software development. I started using AndroMDA in my J2EE projects, and soon started contributing patches to AndroMDA. Sortly after, I was invited to join AndroMDA as a committer.

Gentleware is a well-known company in the realm of modeling tools and I first met Gentleware's CEO Marco Boger at JAX 2004 when Matthias Bohlen and I gave a talk on AndroMDA. In 2006, Gentleware were looking for a Software Architect to join their team and help them to further develop their new Eclipse based roundtrip engineering tool Apollo.

My main areas of work in my new job will be to help make Apollo a great UML tool that integrates with model driven approaches like MDA and MDSD. Also, I will serve as a Software Architect on J2EE projects.

If you happen to be at OOP 2007 in Munich, just drop by the Gentleware booth and say hi. I will be there not only to present Apollo and Poseidon (our modelling tools), but also to give a talk on Open Source MDA.

3
May

Sucessful adoption of AndroMDA in a large project

Issue 03/2006 of the german OBJEKTspektrum contains an article by me and Matthias Bohlen titled Erfolgreicher Einsatz von AndroMDA bei Lufthansa Systems (Sucessful adoption of AndroMDA at Lufthansa Systems). In this article, we discuss how AndroMDA has been used in a large Java based project for a german logistics service provider. You can read the article online.

24
Dec

Android Screen Video

As it is christmas, I decided to give away a christmas present. Many people have been asking for an Eclipse plug-in for AndroMDA to make this MDA toolkit more easier to use. I have begun working on such a plug-in. It is not yet finished, but I decided to give you a short demo so you can see how it is going to look like.

You can start the screen video by clicking here (you'll need Flash, and make sure you have your speaker turned on).

Merry Christmas!

Peter

22
Dec

Paper on AndroMDA

Daniel Schulz has written a nice paper titled "MDA Frameworks: AndroMDA" on AndroMDA. Read it here (it is written in German).

There are two things I particularly like about the paper: Daniel demonstrates why it is a good idea to use OCL to write queries, and he refers to Android.

Why it is a good idea to write queries in OCL

Most enterprise applications have to deal with a certain amount of data, so almost all models for enterprise applications do contain a rather large number of entities. Querying the database for information is one of the most popular operations being performed in enterprise applications. You do it almost all of the time. Depending on which persistence framework you are using, you'll have to use the correct query language. If you persistence framework is Hibernate, you're likely to use HQL to create your queries. If you're using EJB, you'll want to use EJB-QL.

As we all know, MDA is about raising the bar of abstraction. We have the PIM (Platform Independent Model) and the PSM (Platform Specific Model). The PIM should not contain any platform-specific assumptions. So, we should avoid using platform-specific things like HQL or EJB-QL in our PIMs. That's where OCL comes to the rescue: OCL is a platform-independent query language and can be translated to almost any platform specific query language. AndroMDA features OCL translation libraries for HQL and EJB-QL.

Using OCL, you can make your models more re-usable, since you can change the persistence framework more easily.

Android

Daniel refers to Android and states that it will contain "everything but a modelling tool" that one will need for using AndroMDA. I am working hard to make this dream come true. Currently, I am working on the configuration editor. You will soon be able to edit the andromda.xml file with a cool Eclipse Forms-based graphical editor.

25
Nov

AndroMDA 3.1 has been released

AndroMDA (pronounced "Andromeda") is an extensible generator framework that adheres to the Model Driven Architecture (MDA) paradigm. Models from UML tools will be transformed into deployable components for your favorite platform (J2EE, Spring, .NET). Unlike other MDA toolkits, AndroMDA comes with a host of ready-made cartridges that target today's development toolkits like Axis, jBPM, Struts, JSF, Spring and Hibernate. AndroMDA also contains a toolkit for building your own cartridges or customize existing ones - the meta cartridge. Using it, you can build a custom code generator using your favorite UML tool.

A list of new features can be found here.

For more information, go to the AndroMDA website or download AndroMDA from Sourceforge.net. If you need support, you can get it in the support forum.