September 22, 2004
MDA ExplainedWill the 4 Ms -- models, metamodels, mappings and markings -- save software?Tamara Carter
Will the 4 Ms -- models, metamodels, mappings and markings -- save software?
Software Development
MDA Explained
Will the 4 Ms save software?
"What's the problem? Stephen J. Mellor, chief scientist at Accelerated Technologies, asked in his Sept. 20, 2004, afternoon tutorial on model driven architecture (MDA). "The problem is a perennial one—software is expensive and productivity is low. Why? According to Mellor, who's also a coauthor of MDA Distilled (Addison-Wesley, 2004) and chair of an OMG Analysis and Design Task Force Working Group, it's partially because code exists at too low a level of abstraction. Over the past 30 years, Mellor said, studies have shown that the number of lines of code a person can write during one day is constant—no matter the language. "So a line of Java and C is obviously more efficient than a line of assembly code, he continued.
But the problems don't stop at the code level; Mellor also believes that reuse occurs at too low a granularity, that there's too much glue code being written, and, worst of all, that the mapping information is lost. "You bind things together based on rules in your head, Mellor explained. "Once you've produced the artifact, how you created it is lost. This loss of information becomes critical as systems grow because "we have to apply that expertise over and over again. Obviously, that does not scale.
How will MDA solve the software problem? Imagine you walk into a bakery, Mellor told the class, and you see a chocolate cake that's perfect in every way—except that it's chocolate. "Can you imagine asking the baker if he can just take out the chocolate and put in carrots? Mellor continued. "Well, MDA is a way to separate your ingredients so that you can have whatever kind of cake you want.
Models, etc. MDA is a mammoth topic. While Mellor used the structure of his book to guide the tutorial, he further distilled MDA down to just four technical elements: models, metamodels, mappings and marks. Of those four, he holds models and mappings primary. In the software world, Mellor explained, technologies change at their own rate, which is why it's important to keep them separate. "If we can do this, then models and mappings become assets.
A good model, according to Mellor, is derived by separating layers by subject so that each is platform-independent. Using an elevator as example, he told the class that each of the four connected models—Elevator, Transport, Device I/O and User Interface—is independent of (orthogonal to) each other. "Any model that we see that has a button class is wrong, he warned. "Why? Has anybody seen Star Trek? Tomorrow we may have voice recognition.
"How do you know that your model is complete and you're ready to map to code? an audience member asked. "You don't, Mellor, a supporter of executable UML, shot back. But you can determine that executable models are complete at the requirements level. "If you're not using executable models, then you're dependent on review.
Moving ahead to the second M, Mellor explained that a metamodel contains instances of and refers to other models, defining the structure, semantics and constraints for a group of models. (In fact, the UML specification is itself a metamodel, derived using the OMG's Meta-Object Facility, or MOF.)
What about the relationships among a group of models; their "mappings? When people usually talk about mapping, Mellor explained, they're usually talking about "refining, or transforming one model into another. However, a mapping called merging is, according to Mellor, more important. "This type of mapping doesn't turn one thing into another; it draws correlations between models.
According to Mellor, a metamodel lets you state mapping rules for a model's classes, attributes and so on, "rather than manipulating specific classes in the developer model. This paves the way for a standard mapping tool: QVT (Queries, Views and Transformations), which reads from and produces MOF models. And, in MDA, when a change is made, the mapping is repeatable. "It's all about automation, Mellor enthused.
While Mellor holds mappings and models as the most important of the four Ms, markings and metamodels are also required. "You need marks to direct the mappings, he explained, "and metamodels to model the models. A marking provides additional information to direct how mappings operate, said Mellor. "A mark is an adaptor between source and target models.
Hmm...Will the four Ms make MDA more palatable to developers? Tune in next year.
—Tamara Carter
|
|
||||||||||||||||||||||||||||
|
|
|
|