Will MDA Tooling Finally Go Mainstream?
Open-source XOCL may be the first step in an expansion of MDA tools, making it possible to use MDA for a wide range of domains
By Michael Guttman
In a previous column, I described how model-driven architecture (MDA), a set of modeling standards endorsed by the Object Management Group (OMG), has been leveraged extensively in the design and implementation of the Eclipse Modeling Framework (EMF). EMF is an important and widely used extension of the popular open-source Eclipse tooling platform used for model-driven development (MDD).
Using EMF, software applications can be modeled in standard languages, such as the Unified Modeling Language (UML). EMF will then automatically generate much - or in some cases, all - of the code and other software artifacts needed to deploy those applications. EMF also forms the basis for some well-known proprietary MDD tools, such as IBM's Rational Software Architect (RSA).
Therefore, in the sense that MDA is already at the heart of many MDD tools, we could say that MDA tooling has already gone mainstream. But, as I've noted in other columns, MDA can be used for a lot more than just MDD.
Until recently, however, using MDA to support a broader range of domains has typically meant acquiring - and learning to use - highly specialized proprietary tools, as well as developing custom tools in some cases. That requires not only a lot of work, but also a lot of arcane technical tool development and support skills, which are in very short supply. And, for end users, there is the risk of vendor lock-in.
Not suprisingly, the lack of a broadly accepted generic MDA toolset has tended to discourage even relatively sophisticated end users from applying MDA directly to problem domains beyond MDD. This creates a classic chasm for broader MDA adoption: Users won't adopt MDA approaches in other domains without robust tool support, but commerical tool vendors can't afford to provide and support such tools until there are significant numbers of customers demanding MDA-based tools for those domains.
Fortunately, there is now an open-source project, called XOCL (www.XOCL.org), that is attempting to cross that chasm. The XOCL project is implementing a tool suite, based on standard EMF, that can be quickly configured to provide MDA support for a wide range of domains. Even better, XOCL is a relatively simple veneer over standard EMF, making it easily accessible to the thousands of users already familiar with that environment.
In short, XOCL simply adds some basic ease of use and best-practice automation on top of EMF's already-robust implementation of the Essential Meta Object Facility (EMOF) and the Object Constraint Language (OCL). Thus, XOCL users just need to know the standard modeling formalisms of EMOF and OCL to create full-working MDA applications, all without any coding. This allows XOCL to expose to non-developers much more of the full range of MDA capabilities that are already available in the EMF core.
The vast majority of the code base for XOCL remains within EMF - a free, widely available, and standards-based open-source product with extensive support, already used daily by tens of thousands of developers. As a result, XOCL also automatically integrates with many other widely used Eclipse-based facilities without any special effort. And, of course, XOCL users completely avoid any vendor lock-in.
Although the XOCL project has been going on for several years, the resulting XOCL platform is still in its early stages. However, if XOCL starts to gain some traction with MDA users, it could signal the beginning of a much broader opening up of the MDA tool marketplace.
End users can now begin to confidently experiment with XOCL to use MDA for wider purposes than MDD. Also, MDA vendors could potentially benefit by migrating their existing products to - or basing new products on - the XOCL framework, which provides easy access to a robust and integrated set of MDA facilities.
How XOCL Works
In any case, XOCL provides a very good example of how a general-purpose MDA tool works, and how it can be integrated into mainstream tooling environments, such as Eclipse. There are two main ways to use the XOCL platform:
modeling directly in EMOF/OCL, and
specifying a domain-specific language (DSL), then modeling using that DSL.
Using XOCL to model directly in EMOF/OCL is the easiest way to get started, especially for those who are relatively new to MDA. First, we define the structure of our model using EMOF, and then we elaborate that model with constraints and behavior using OCL. This is somewhat like creating UML models, but much easier, because the set of modeling concepts needed to understand and use XOCL is much smaller and less complex than for full-blown UML. At the same time, everything within XOCL is industry-standard and supported completely within the EMF platform.
The second - more sophisticated - way to use the XOCL platform is to first specify a DSL, and then create domain models using that DSL. This approach is useful if we want to create a set of different - but closely integrated - domain models. It is also useful if we want to further specialize and/or restrict the set of modeling concepts to be used by domain modelers. It is already possible to define a DSL within standard EMF, but XOCL makes it much easier to do.
For example, suppose we want to develop a closely related set of banking domain models. First, we use XOCL to specify a banking-specific DSL. Our banking DSL will formally define the set of banking-specific concepts we need. The structures, syntax, and constraints we define at the DSL level will then be automatically applied and enforced by XOCL for all subsequent models we create with our banking DSL.
Even better, XOCL then automatically creates simple, intuitive tree editors for specifying models in our new DSL. These tree editors enforce all of the specifications of the DSL, making it impossible for our banking domain modelers to violate those specifications. They also store the resulting models in the Eclipse repository, where the model elements can be reused in other models and/or views. If using a generic tree editor to create domain models does not suit the needs of business users, it is possible to create a custom graphical editor using standard Eclipse tools and integrate that into the XOCL environment.
So, using XOCL, we can incrementally refine our DSL as we work on creating domain models. As we discover new model concepts or constraints, we can add them to our DSL, and XOCL will automatically add them to our DSL model tree editors. Only once our DSL model is stable do we need to think about building a custom model editor.
XOCL also supports creating and executing run-time instances of domain models. This is an extremely powerful feature, which only exists on a few very sophisticated proprietary platforms. However, by once again leveraging the MDA-based core of EMF, XOCL also implements this feature using only a thin veneer over standard EMF.
In XOCL, the simplest way to exploit this feature is to manually invoke the generic instance editors that XOCL automatically generates for each model element. With these simple tree editors, we can populate run-time instances for any model element. That instance data is stored in the standard Eclipse repository, or in an external database of choice linked to that repository. If that database is already populated, the model instances will automatically be drawn from its data elements.
Once the instance data is available, we can then request the tree editors to execute any operations defined in the model on those instances to test what happens. The XOCL instance editors are themselves model-driven at runtime, so they automatically enforce the constraints we specified in our models, even when we first manually enter instance data.
For those familiar with Eclipse, it is possible to integrate XOCL models with virtually any external data store and create almost any kind of custom graphical editor, input screen, or custom report.
Using all of these available facilities, it is possible to interactively and incrementally create a wide variety of end-user applications that are truly model-driven. XOCL may just be one small step from the already powerful code base of EMF, but it could be a giant step forward for the future of MDA tooling.
Michael Guttman, CEO of The Voyant Group, LLC - a U.S.-based IT consultancy focused on enterprise modeling - is a regular columnist for Software Magazine and co-author of Real-Life MDA (Elsevier, 2006). E-mail him at firstname.lastname@example.org.
Jul2010, Software Magazine