250 likes | 443 Vues
An Overview of the Model-Driven Architecture. Jacques Robin. Outline. What is MDA? MDA Principles MDA Process and Software Reuse OMG MDA standards Third party providers roles, standards and tools. What is Model-Driven Architecture (MDA)?.
E N D
An Overview of the Model-Driven Architecture Jacques Robin
Outline • What is MDA? • MDA Principles • MDA Process and Software Reuse • OMG MDA standards • Third party providers roles, standards and tools
What is Model-Driven Architecture (MDA)? • An initiative from the Object Management Group (OMG) started in 1997, www.omg.org/mda/ • New paradigm of software development • Goals: • Maxime software reuse across platforms • Solve the second order interoperability problem among different middleware (which goal was to solve the first order interoperability problem among programming languages) • Raise the level of abstraction where most development effort is spent from code to model • Provide standards to automate the entire software development process through a model transformation approach • Reuses and extends previous standards • Unified Modeling Language (UML), by OMG • Meta-Object Facility (MOF), by OMG • eXtensible Markup Language (XML), by W3C (World-Wide Web Consortium, www.w3c.org/xml/)
MDA Principles • The most valuable, durable, reusable assets produced during the development process is not code but models • Far more significant and cost-effective quality gains are achievable by improving design and models than by improving code • Benefits from careful, detailed, explicit modeling is not limited to the application under development but extend to all the processes, artifacts, languages, tools and platforms used for this development
MDA Principles • A high degree of software process automation can be achieved by: • Building a variety of models, each one with a different role in the process, • Making each of these models machine processable by expressing it in a semi-formal notation devoid of natural language • Defining this notation itself as an object-oriented model (called a meta-model) • Storing all models and meta-models with traceability links in a repository accessible to model manipulation software • Abstracting generic transformations between pairs of meta-models that computationally codify the know how for one software process stage • Using model transformation engines to apply these transformations to the source model of a process stage and generate the target model of that stage • Define meta-models for the meta-modeling and model transformation notations
Testing Model Platform Meta-model Testing Meta-model Requirement Meta-model CIM Meta-model PIM Meta-model PSM Meta-model Testing Code Application Platform Specific Model Application Source Code Application Platform Independent Model Testing Code Meta-Model Source Code Meta-Model Meta-Meta-Model Textual Meta- Meta-Model MDA Software Process Domain Computation Independent Model Application Requirement Model Platform Model
Platform Q Model Application A Platform Q Specific Model Testing Model AQ Application B Platform Q Specific Model Testing Model BQ Application B Platform P Specific Model Testing Model BP Artifact Reuse with MDA Process Application A Requirement Model Platform P Model Application A Platform P Specific Model Testing Model AP Application A Platform Independent Model Application B Platform Independent Model Domain Computation Independent Model Application B Requirement Model
Model Transformation Meta-model Model Transformation Engine Requirement Meta-model CIM Meta-model Application Requirement Model PIM Meta-model Application Platform Independent Model Domain Computation Independent Model Automated MDA Process: Design Design Transformations
Model Transformation Meta-model PIM Meta-model Model Transformation Engine Platform Meta-model PSM Meta-model Automated MDA Process: Implementation PIM PSM Transformations Platform Model Application Platform Specific Model Application Platform Independent Model
Model Transformation Meta-model Model Transformation Engine PSM Meta-model Automated MDA Process: Code Generation Source Code Meta-Model Code Generation Transformations Application Platform Specific Model Application Source Code
Model Transformation Meta-model Model Transformation Engine PSM Meta-model Requirement Meta-model Testing Meta-model Application Requirement Model Automated MDA Process: Test Generation Test Generation Transformations Application Platform Specific Model Testing Model
Model Transformation Meta-model PIM Meta-model Model Transformation Engine Platform Meta-model PSM Meta-model Automated MDA Process: Reverse Engineering PSM PIM Reverse Engineering Transformations Platform Model Application Platform Specific Model Application Platform Independent Model
Model Transformation Meta-model Model Transformation Engine PIM Meta-model PIM Meta-model Automated MDA Process: PIM Refactoring PIM Refactoring Transformations Refactored PIM Legacy PIM
Model Transformation Meta-model Model Transformation Engine PSM Meta-model PSM Meta-model Automated MDA Process: PSM Refactoring PSM Refactoring Transformations Refactored PSM Legacy PSM
Model Transformation Meta-model Model Transformation Engine Automated MDA Process: Code Refactoring Source Code Meta-Model Source Code Meta-Model Code Refactoring Transformations Refactored Source Code Legacy Source Code
OMG Tasks in MDA Initiative • Define meta-modeling standard: Meta-Object Facility (MOF) • Define general-purpose visual modeling standard: Unified Modeling Language (UML) • Define complementary general-purpose, semi-formal textual modeling standard to make both MOF metamodels and UML models more precise and devoid of natural language: Object Constraint Language (OCL) • Define general-purpose, both machine-processable and user-readable persistent textual format for both MOF meta-models and UML models: XML Model Interchange (XMI) • Define model manipulation standard: Query View Transform (QVT) • Each of these standards to be defined in terms of: • Abstract syntax as a MOF meta-model • Concrete syntax (visual or textual) • Formal semantics (very partial up to now)
XMI OCL QVT Basic UML2 Superstructure Classes Attributes Types Packages ... ... Behavioral Structural EMOF Activities Actions States Transitions ... Components Ports ... CMOF Relationships between OMG’s MDA standards UML2 Infrastructure ... Constructs Associations ... merge merge merge MOF2 merge merge merge
system +name actor +name useCase +title Example Meta-Model 1 .. * extends extends MOF Meta-Model of Use-Cases 1 ..* 1 ..* 0 ..1 includes e-Store OrderItem UML Model: Use-Case Diagram ValidateCart
association +name class +name parameter +direction operation +name associationEnd +name +multi attribute +name +multi system +name actor +name useCase +title package +name Example Meta-Meta-Model MOF Meta-Model of MOF Meta-Model 1 .. * extends MOF Meta-Model of UML Use-Cases extends 1 ..* 1 ..* 0 ..1 includes
extends 0 ..* useCase +title system +name * actor +name 0 ..1 includes Example of XMI Encoding <umlModel> <useCase id = “oiuc”> <title,visib = pub> “orderItem” </title> </useCase> <useCase id = “vcuc”> <title,visib = pub> “validateCart” </title> </useCase> <actor id = “ca”> <name, visib = pub> “Client” </name> </actor> <system id = “ess”> <name, visib = pub> “e-Store” </name> </actor> <actor2useCase id = “ca2oiuc”> <in idref = “ca”/> <out idref = “oiuc”/> </actor2useCase> <actor2useCase id = “ca2vcuc”> <in idref = “ca”/> <out idref = “vcuc”/> </actor2useCase> </umlModel> e-Store orderItem validateCart Client
Other Stakeholders’ Tasks in MDA Initiative • Platform providers: • Define platform model as UML Profile or PSM meta-model in MOF • Multiple domains or wide domain application providers: • Use only standards defined by OMG and platform providers • Narrow domain application providers: • Define special-purpose modeling languages in MOF • MDA CASE tool providers: • Implement model base development and management services such as edition, syntactic validation, import, export, persistence, query, access control, versioning and traceability for: • Models in UML, OCL and MOF-specified user-defined languages • MOF meta-models • QVT and MOF-specified model transformation languages • Define APIs to program new model processing services on top of theses basic services • Implement model transformation engines based on MOF and QVT • Implement code and test generation services from PSM
MDA Third-Party Standards and Tools • Java Modeling Interface (JMI): • Standard from Java Community Process (JCP) • Defines a set of Java interfaces to process models represented as Java objects: • Reflective interfaces define general model manipulation operations that are independent of the model’s meta-model • Taylored interfaces define model manipulation operations that are specific to models that follow a given meta-model • Taylored interfaces can be automatically generated from a MOF meta-model • Eclipse Modeling Framework (EMF): • Standard from the Open Source Java-Based IDE project Eclipse (www.eclipse.org) • Plug-in for Eclipse IDE framework • Implements similar reflective and taylored interfaces than JMI • Implements generation of taylored interface from MOF meta-model • Implements generation of Eclipse-integrated model editor from MOF meta-model
programmatically represents textually represents XMI Schema MOF Meta-model (meta-meta-model) generates Java Reflective Interfaces programmatically represents textually represents XML Schema process Meta-model Java Taylored Interfaces create / process textually represents XML Document programmatically represents Java Objects import / export Model representation as XML document and Java Objects Main Memory File System Model
Java Model Representation vs. Implementation • Java objects generated using the taylored and reflective interfaces of JMI or EMF merely represent model elements • They only provide a handle to process these elements using Java • They are completely different from Java objects that implementthese model elements • Though among many other uses, theses model representation Java objects can be used as input to program in Java the generation of model implementing Java objects • But they could also be used to generate a C++ or Prolog implementation of the application or any other MDA service • Java model representation objects are useful for MDA CASE tools during the development process of an application, whereas Java model implementation objects are useful for this application • In one case, Java is used to implement CASE tools functionalities, in the second case, Java is used to implement application functionalities