This blog is designed for the advanced Rational Rhapsody user and/or developer. Rhapsody is a graphical tool, from IBM, built for designing software systems (with an emphasis on real-time software systems). You describe your systems graphically (following the rules of the Unified Modeling Language or UML), push a button and out comes software source code. By default you get C, C++ or Ada. Most projects I’ve been on are C++ ones. That’s all fine and dandy until the day:
- You wan’t something ELSE to come OUT of the tool (another language to be produced)
- You want something ELSE to go INTO the tool models (custom annotations, code snippets, etc.)
So this blog is my way to capture how to do these two kinds of activities and that means meta-programming, you know, code that writes code. Rhapspody (the tool) provides a Java API for folks to manipulate and interrogate models built by the tool. Want to generate some XML from your model? The API allows enables you to do that. Want to generate a custom spreadsheet with information from a model? Use the API. To be clear, the API gives you access to your models but YOU have to figure out how to produce the document or output you want. That is what I’ve been doing for the last 12 or so years. This blog assumes that you, dear reader, have been using UML Model Driven Development for a while now with tools like IBM Rational Rhapsody, IBM Rational Rose, maybe NoMagic. I’ll focus on Rhapsody here, but most of the big tools in this space provide some kind of API to make the tool do extraordinary things.