model driven development -...

22
Real-Time Computing and Communications Lab., Hanyang University http://rtcc.hanyang.ac.kr Real-Time Computing and Communications Lab., Hanyang University http://rtcc.hanyang.ac.kr Model Driven Development Minsoo Ryu Hanyang University [email protected]

Upload: others

Post on 24-Dec-2019

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Model Driven Development

Minsoo Ryu

Hanyang University

[email protected]

Page 2: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

2Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 2Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Contents

MDA ConceptsModel TransformationMetamodel and MOF

Page 3: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

3Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 3Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Model-Driven Engineering

Model-driven engineering (MDE) is the systematic use of models as primary engineering artifacts throughout the engineering lifecycle MDE can be applied to software, system, and data

engineering Models are considered as first class entities

The best known MDE initiative is the Object Management Group (OMG) called Model-Driven Architecture (MDA), which is a registered trademark of OMG Another related acronym is Model-Driven Development

(MDD) which is also an OMG trademark

Page 4: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

4Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 4Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

OMG Model-Driven Architecture

The Model Driven Architecture (MDA) is a framework for software development defined by the Object Management Group (OMG) Key to MDA is the importance of models in the software

development process Within MDA the software development process is driven by

the activity of modeling your software system

Page 5: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

5Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 5Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Traditional Approach vs. MDA

Traditional Approach MDA Approach

Page 6: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

6Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 6Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Platform

A platform is a set of subsystems and technologies that provide a coherent set of functionality through interfaces and specified usage patterns, which any application supported by that platform can use without concern for the details of how the functionality provided by the platform is implemented

Examples include language, OS, and middleware platforms Language: Java, C, C++ OS: Linux, Windows, Solaris Middleware: CORBA, Java 2 Enterprise Edition (J2EE),

Microsoft .NET

Page 7: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

7Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 7Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Platform Independent Model (PIM)

PIM The first model that MDA defines is a model with a high level

of abstraction that is independent of any implementation technology

A PIM describes a software system that supports some business Within a PIM, the system is modeled from the viewpoint of

how it best supports the business Whether a system will be implemented on a mainframe with a

relational database or on an EJB application server plays no role in a PIM

Page 8: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

8Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 8Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Platform Specific Model (PSM)

PSM Is used to specify the system in terms of the implementation

constructs that are available in one specific implementation technology

For example, an EJB PSM is a model of the system in terms of EJB structures

• It typically contains EJB-specific terms like "home interface," "entity bean," "session bean," and so on

A relational database PSM includes terms like "table," "column," "foreign key," and so on

A PIM is transformed into one or more PSMs For each specific technology platform a separate PSM is

generated Most of the systems today span several technologies, therefore

it is common to have many PSMs with one PIM

Page 9: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

9Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 9Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Contents

MDA ConceptsModel TransformationMetamodel and MOF

Page 10: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

10Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 10Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Model Transformation

Generic transformations Implement best practices,

architectural and design patterns, technology patterns, optimizations, etc.

Additional information Adjust the transformation globally Similar to compiler options

Model markup Direct the transformation of

particular model elements Not part of the PIM Different platform mappings may

require different markup Similar to compiler pragmas

Page 11: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

11Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 11Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Model Transformation

The basic pattern of model transformation can be applied multiple times

PIMs and PSMs are relative notions “Someone’s PIM can be someone else’s PSM”

Platform independence is relative, too It’s a scoping issue It’s a strategic decision

Page 12: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

12Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 12Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Automatic Model Transformation

Traditionally, the transformations from model to model, or from model to code, are done mainly by hand

Now, many tools can generate some code from a model, but that usually goes no further than the generation of some template code, where most of the work still has to be filled in by hand

The eventual goal of MDA is to generate complete code from a model via model compilers

Page 13: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

13Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 13Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

MDA Benefits

Raising the level of abstraction Raising the level of reuse Design-time interoperabilityModels as reusable assets

Page 14: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

14Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 14Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Consequent Benefits

Productivity Developers can focus on the development of PIMs They can work independently of details and specifics of the

target platforms These technical details will be automatically added by the

PIM to PSM transformation Portability

The same PIM can be automatically transformed into multiple PSMs for different platforms

Maintenance and documentation The PIM fulfills the function of high-level documentation that

is needed for any software system 100% traceability from specification to implementation

Page 15: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

15Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 15Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Contents

MDA ConceptsModel TransformationMetamodel and MOF

Page 16: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

16Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 16Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

OMG Standards for MDA

Modeling: UMLMetamodeling: MOF Action semantics: UMLModel interchange: XMI Diagram interchange: UML

Page 17: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

17Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 17Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Metamodel

Metamodel Model of a modeling language Definition of syntax and semantics

MOF provides a set of concepts to define metamodels; in particular Class diagrams to define abstract syntax and OCL to define semantics of a modeling language

Example: UML metamodel Semantics is defined using a mixture of OCL and informal

text

Page 18: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

18Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 18Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Four-Layer Metamodel Hierarchy

Page 19: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

19Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 19Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Four-Layer Metamodel Hierarchy

Page 20: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

20Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 20Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Overview of MOF 1.4 Metamodel

Page 21: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

21Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 21Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Model Transformation and MOF

Page 22: Model Driven Development - Hanyangosdc.hanyang.ac.kr/sitedata/2016_02_Under_SE/18_Model_Driven_Development.pdfA PIM is transformed into one or more PSMs For each specific technology

22Real-Time Computing and Communications Lab., Hanyang University

http://rtcc.hanyang.ac.kr 22Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr

Discussions on MOF

Benefits Standard way to define modeling languages “MOF is not just for OO”

• i.e., can be used to define non-OO modeling languages Caveats

No means to declare concrete syntax and editing behavior• Abstract syntax: • Concrete syntax:

Scoped not just for creating modeling languages, but also for metadata management Eclipse provides a simple, proprietary metamodeling

framework – Eclipse Modeling Framework (EMF); the centerpiece of EMF is Ecore, which corresponds to MOF