Chapter 7. Building Languages


So far, we've talked about metamodels in a rather abstract manner. It's now time to discuss how metamodels are used to define languages. (This is often done by third parties, so fear not.)

At one level, a metamodel is just a model, so if we wish to define a language, we ought to be able to model it, in UML for example, and away we go. However, the business of writing mapping functions would become impossibly difficult without some commonalities among the various metamodel definitions, so it's helpful to have an agreed-upon subset of the UML; that subset is the MOF.

Building a model for a large language from scratch can be complex and difficult work, and since modeling languages share many common properties, it's unnecessarily expensive. It's sometimes better to subset or extend an existing language. The UML provides another approach to define a language: by extending or subsetting the UML using one or more profiles.

A language requires a concrete syntax and tools to manipulate it. In the text-based world, this is easy to do, but in the graphical world, there are fewer tools. By combining the techniques of MOF metamodeling and UML profiles, we show how it is possible (if kludgy) to represent non-UML models using UML.

Whichever approach you use, you're defining a language, so let's start by examining what it is about a language that we need to capture and how we can represent that by a metamodel.



MDA Distilled. Principles of Model-Driven Architecture
MDA Distilled. Principles of Model-Driven Architecture
ISBN: B00866PUN2
EAN: N/A
Year: 2003
Pages: 134

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net