tool support for modeldriven development in practice · istituto di scienza e tecnologie...
TRANSCRIPT
Istituto di Scienza e Tecnologie dell'Informazione “A. Faedo”Software Engineering Laboratory
Tool support for modeldriven Tool support for modeldriven development in practicedevelopment in practice
PisaTel MeetingRoma, 29 novembre 2007
Antonino SabettaISTI-CNR, Pisa
SOFTWARE ENGINEERING LABORATORY
MDD: what's it all about?» Making software is a matter of:
» art and inspiration?» craftsmanship?» engineering bestpractices?» industrial production (i.e. automated, repeatable)?
» Model Driven (MD) approaches advocate» expressing design artifacts in a machinereadable format» automatically obtain new artifacts from existing ones
» model transformation» code generation» reverse engineering
SOFTWARE ENGINEERING LABORATORY
What can I do with models that I can't do without
» Modeling as a means for....» Better/easier/higherquality design
» Raising the level of abstraction» Gain better understanding of design choices and their
implications» (Early) analysis
» functional verification» extrafunctional verification (performance,
schedulability)» Automated implementation (i.e. code generation)
» you want code eventually, don't you?
SOFTWARE ENGINEERING LABORATORY
Different tools for different purposes
» Metamodeling» Modeltomodel transformation» UML modeling» Code generation» Modeldriven analysis
SOFTWARE ENGINEERING LABORATORY
Different tools for different purposes
» Metamodeling» Modeltomodel transformation» UML modeling
» methodologyneutral» methodologyspecific
» Code generation» Modeldriven analysis
SOFTWARE ENGINEERING LABORATORY
Papyrus UML» feature highlights
» Eclipsebased, free, open source, actively developed» OMG standards compliant (v.2.0)» open development process» developed by knowledgeable people, directly involved in OMG
standardization process (MARTE OMG profile for Modeling and Analysis of Real Time Embedded Systems)
» Both SysML and MARTE are already implemented in Papyrus (Papyrus's MARTE is the official reference implementation)
» Supports all the UML standard diagrams» Extremely easy to extend with custom profiles (see next slides)» Code generation (based on Acceleo); C++ and Java supported out
ofthebox, other languages can be added with new templates
SOFTWARE ENGINEERING LABORATORY
Why do I need extensions/annotations?» The UML metamodel:
» is generic» has several semantic variation points (bug or feature?)» BUT it can be customized, specialized, constrained: UML profiles
» What can you do with UML profiles:» tailor the language to your domain and to your development
process and practices» attach a semantics that suits your need (i.e. generate special
code based on the information included in the stereotypes)» augment the model with extra information that is necessary for
performance predictions
SOFTWARE ENGINEERING LABORATORY
Defining a custom profile with Papyrus
SOFTWARE ENGINEERING LABORATORY
Defining a custom profile with Papyrus
SOFTWARE ENGINEERING LABORATORY
Using a custom profile with Papyrus
SOFTWARE ENGINEERING LABORATORY
Under the hood: XMI
SOFTWARE ENGINEERING LABORATORY
Magicdraw (NoMagic Inc.)
» Pros:» Compliant with v.2.0 family of OMG standards; interoperable» Full support for Profiles and consistency checks with constraint
language» Actively developed and maintained» Commercial support
» Cons:» Proprietary tool, expensive
Note: It's a general purpose UML modeling tool (does not attach a specific semantics to models, thus it is not capable e.g. to execute statecharts)
SOFTWARE ENGINEERING LABORATORY
MagicDraw
SOFTWARE ENGINEERING LABORATORY
MagicDraw
SOFTWARE ENGINEERING LABORATORY
MagicDraw
SOFTWARE ENGINEERING LABORATORY
UniMod
» Pros» Development methodology based on statecharts and
events» Statecharts can be directly mapped to C++/Java code
» Note: UniMod assumes a particular semantics for UML statecharts and imposes a predefined design workflow. (All of this could be implemented under the hood via the UML profiling mechanism with a “neutral” modeling tool)
SOFTWARE ENGINEERING LABORATORY
UniMod
» Cons» UniMod 1.3 is based on obsolete UML 1.5 std.» No support for custom annotations, no Profiles (neither
custom nor standard profiles)» No support for interchange, no interoperability» UniMod 2 (was due for April 2007) seems to be dead
SOFTWARE ENGINEERING LABORATORY
UniMod: structural modeling
SOFTWARE ENGINEERING LABORATORY
UniMod: behavioral modeling
SOFTWARE ENGINEERING LABORATORY
UniMod: behavioral modeling
SOFTWARE ENGINEERING LABORATORY
UniMod code generation capabilities
SOFTWARE ENGINEERING LABORATORY
iUML (KennedyCarter)
» Distinguishing features (iUMLite 2.2, free, March 2005)» Executable models (simulates statecharts)» Body of actions is specified with an actionlanguage (ASL),
imperative with some declarative shortcuts for operation on sets
» Latest nonfree version claims to be capable of generating code from statemachines
» Shortcomings» Based on obsolete UML standard (1.5)» No profiles, no extensions (neither std nor custom)» No importexport in free edition
SOFTWARE ENGINEERING LABORATORY
iUML (KennedyCarter)
SOFTWARE ENGINEERING LABORATORY
iUML (KennedyCarter)
SOFTWARE ENGINEERING LABORATORY
Modeling to automate implementation
» Code generation» Acceleo
» Eclipse based» incremental code generation» produce code by populating templates» the meaning of the model (how modeling elements map to actual
code) is expressed in the codegeneration process
» Alternatives: AndroMDA, StringTemplate, JET
SOFTWARE ENGINEERING LABORATORY
Conclusion
» Models are used for a number of purposes» Tools cover different areas
» highlevel design, architectural modeling» predictive analysis, early verification» code generation, reverse engineering
» Different approaches» some tools offer fuller use of the standard but require that the language
and the design process be tailored for your purposes (very flexible, but exploit this flexibility implies making customizations)
» others come packaged with predefined design workflow and specialized features (quicker adoption, but less flexible)
SOFTWARE ENGINEERING LABORATORY
Discussion
» Open vs closed vs proprietary» interoperability is an issue» support for std interchange formats
» Builtin support for executable models» Interfacing with 3rd party code generation engines» Support for profiling/annotations» Support for latest OMG standard specifications» Active development; frequent updates and fixes» Community support and good documentation