Model-Driven Software Development

Slides:



Advertisements
Similar presentations
Language Specification using Metamodelling Joachim Fischer Humboldt University Berlin LAB Workshop Geneva
Advertisements

Profiles Construction Eclipse ECESIS Project Construction of Complex UML Profiles UPM ETSI Telecomunicación Ciudad Universitaria s/n Madrid 28040,
OMG‘s MDA: An Overview copyright © 2001, MATHEMA AG OMG‘s MDA: An Overview OMG‘s MDA: An Overview Markus Völter
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB JavaForum.
UML CASE Tool. ABSTRACT Domain analysis enables identifying families of applications and capturing their terminology in order to assist and guide system.
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
Model Driven Architecture (MDA) Partha Kuchana. Agenda What is MDA Modeling Approaches MDA in a NutShell MDA Models SDLC MDA Models (an Example) MDA -
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
Whole Platform Tesi di Dottorato di: RICCARDO SOLMI Università degli Studi di Bologna Facoltà di scienze matematiche, fisiche e naturali Corso di Dottorato.
Generative Programming. Generic vs Generative Generic Programming focuses on representing families of domain concepts Generic Programming focuses on representing.
Course Instructor: Aisha Azeem
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
MDA Guide Version CYT. 2 Outline OMG Vision and Process Introduction to MDA How is MDA Used? MDA Transformations Other MDA Capabilities Using the.
Software Engineering Muhammad Fahad Khan
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
UML - Development Process 1 Software Development Process Using UML (2)
An Approach and Tool for Synchronous Refactoring of UML Diagrams and Models Using Model-to-Model Transformations Hafsteinn Þór Einarsson Helmut Neukirchen.
Xactium xDSLs Run Models Not Code Tony Clark
Faculty of Informatics and Information Technologies Slovak University of Technology Peter Kajsa and Ľubomír Majtás Design.
MDA and QVT  Tom Gullion, Director of Product Management, Together Products.
XML in Development of Distributed Systems Tooling Programming Runtime.
Mihir Daptardar Software Engineering 577b Center for Systems and Software Engineering (CSSE) Viterbi School of Engineering 1.
I n g e n i e u r b ü r o f ü r s o f t w a r e t e c h n o l o g i e w w w. v o e l t e r. d e © M a rk u s V ö l t e r. MDSD Best Practices -
MDE Model Driven Engineering Xavier Blanc Université Pierre et Marie Curie
Model transformation with a dedicated imperative language IRISA Rennes (France) - Triskell team Jean-Marc Jézéquel Didier Vojtisek Jean-Philippe Thibault.
Introduction to MDA (Model Driven Architecture) CYT.
I n g e n i e u r b ü r o f ü r s o f t w a r e t e c h n o l o g i e w w w. v o e l t e r. d e © M a rk u s V ö l t e r MDSD Intro & Overview.
I n g e n i e u r b ü r o f ü r s o f t w a r e t e c h n o l o g i e w w w. v o e l t e r. d e © M a rk u s V ö l t e r. Using DSLs in Practice.
Alignment of ATL and QVT © 2006 ATLAS Nantes Alignment of ATL and QVT Ivan Kurtev ATLAS group, INRIA & University of Nantes, France
2nd TTCN-3 User Conference, June The TTCN-3 Metamodel – A Basis for Tool Integration Ina Schieferdecker TU Berlin/Fraunhofer Fokus Hajo Eichler,
D O M A I N – D R I V E N D E V E L O P M E N T: Introduction i n g e n i e u r b ü r o f ü r s o f t w a r e t e c h n o l o g i e w w w. v o e l t e.
ISO/IEC CD and WD : Core Model and Model Mapping ISO/IEC JTC1/SC32/WG September 2005, Toronto SC32/WG2 Japan (Kanrikogaku Ltd) Masaharu.
University of Southern California Center for Systems and Software Engineering Model-Based Software Engineering Supannika Koolmanojwong Spring 2013.
Selected Topics in Software Engineering - Distributed Software Development.
Generative Programming. Automated Assembly Lines.
MODEL-BASED SOFTWARE ARCHITECTURES.  Models of software are used in an increasing number of projects to handle the complexity of application domains.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 4 Slide 1 Software Processes.
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
MDD-Kurs / MDA Cortex Brainware Consulting & Training GmbH Copyright © 2007 Cortex Brainware GmbH Bild 1Ver.: 1.0 How does intelligent functionality implemented.
Page 1 Hitachi Ltd. – FhI FOKUS TTCN-3 User Conference, June 2005 MDA based approach for generation of TTCN-3 test specifications Hideto Ogawa, Hitachi.
M&CML: A Monitoring & Control Specification Modeling Language
CIS 375 Bruce R. Maxim UM-Dearborn
Advanced Computer Systems
Chapter 1: Introduction to Systems Analysis and Design
UML 2.0 Compliance Points Proposal
SysML 2.0 Formalism: Requirement Benefits, Use Cases, and Potential Language Architectures Formalism WG December 6, 2016.
Object-Oriented Analysis and Design
SysML v2 Formalism: Requirements & Benefits
Introduction to Design Patterns
Web Application Modeling
Object oriented system development life cycle
Evaluating Compuware OptimalJ as an MDA tool
Software engineering -1
JavaServer Faces: The Fundamentals
Analysis models and design models
Constructing MDA-based Application Using Rational XDE for .NET
An Introduction to Software Architecture
Chapter 1: Introduction to Systems Analysis and Design
Execute your Processes
QVT Operational 1.0 Ganymede Simultaneous Release Graduation Review
Applying Use Cases (Chapters 25,26)
Applying Use Cases (Chapters 25,26)
Model Driven Software Development
PASSI (Process for Agent Societies Specification and Implementation)
Rule Engine Concepts and Drools Expert
Chapter 1: Introduction to Systems Analysis and Design
Software Development Process Using UML Recap
Software Architecture & Design
Presentation transcript:

Model-Driven Software Development www.mdsd-buch.de Some Essential Best Practices Markus Völter voelter@acm.org www.voelter.de

Markus Völter About me Independent Consultant voelter@acm.org www.voelter.de Independent Consultant Based out of Heidenheim, Germany Focus on Software Architecture Model-Driven Software Development Middleware

Before we start… I Model-Driven Software Development is about making software development more domain-related as opposed to computing related. It is also about making software development in a certain domain more efficient.

Before we start … II: MDSD on a Slide several Metametamodel target subdomains software software design expertise architecture architecture bounded area of partial composable knowlege/interest knowledge multiple multi-step transform viewpoint Domain single-step compile Model semantics Ontology interpret no precise/ roundtrip Domain executable Specific Language graphical Metamodel textual

Before we start … III: MDSD and MDA MOF several target Metametamodel software software subdomains architecture architecture design expertise bounded area of partial composable knowlege/interest PIM, PSM, .... QVT multiple multi-step transform viewpoint Domain single-step compile Model semantics Ontology interpret no precise/ Domain roundtrip executable Specific OCL, Action Semantics Language UML+ Profiles graphical Metamodel textual Focus: Platform Independence, (Tool) Interop

Best Practices Domain Architecture Tools Process Multi Model C O N T E N T S Domain Architecture Domain Metamodelling Code Generation Tools Features And Structure An Example Process Multi Model Architecture and CBD Adopting MDSD Model-Driven Software Development www.mdsd-buch.de Best Practices

Best Practices Domain Architecture Tools Process Multi Model C O N T E N T S Domain Architecture Domain Metamodelling Code Generation Tools Features And Structure An Example Process Multi Model Architecture and CBD Adopting MDSD Model-Driven Software Development www.mdsd-buch.de Best Practices

How do I come up with a good metamodel? Incrementally! Based on experience from previous projects, and by „mining“ domain experts. A very good idea is to start with a (typically) very well known domain: the target software architecture (platform)  Architecture-Centric MDSD

Talk Metamodel In order to continuously improve and validate the FORMAL META MODEL for a domain, it has to be exercised with domain experts as well as by the development team. In order to achieve this, it is a good idea to use it during discussions with stakeholders by formulating sentences using the concepts in the meta model. As soon as you find that you cannot express something using sentences based on the meta model, you have to reformulate the sentence the sentence’s statement is just wrong you have to update the meta model.

A component owns any number of ports. Talk Metamodel II Example: A component owns any number of ports. Each port implements exactly one interface. There are two kinds of ports: required ports and provided ports. A provided port provides the operations defined by its interface. A required port provides access to operations defined by its interface.

Best Practices Domain Architecture Tools Process Multi Model C O N T E N T S Domain Architecture Domain Metamodelling Code Generation Tools Features And Structure An Example Process Multi Model Architecture and CBD Adopting MDSD Model-Driven Software Development www.mdsd-buch.de Best Practices

Hence you may generate much more than code: Leverage the Model The information captured in a model should be leveraged to avoid duplication and to minimize manual tasks. Hence you may generate much more than code: user guides help text test data build script content, etc. Find the right balance between the effort required for automating manual tasks and the effort of repetitively performing manual tasks Make use of SELECT FROM BUY, BUILD, OR OPEN SOURCE in your assessment.

Separate Generated and Non-Generated Code Keep generated and non-generated code in separate files. Never modify generated code. Design an architecture that clearly defines which artifacts are generated, and which are not. Use suitable design approaches to “join” generated and non-generated code. Interfaces as well as design patterns such as factory, strategy, bridge, or template method are good starting points.

Separate Generated and Non-Generated Code II A) Generated code can call non-generated code contained in libraries B) A non-generated framework can call generated parts. C) Factories can be used to „plug-in“ the generated building blocks D) Generated classes can also subclass non-generated classes. E) The base class can also contain abstract methods that it calls, they are implemented by the generated subclasses (template method pattern)

Produce Nice-Looking Code … whenever possible! PRODUCE NICE-LOOKING CODE … WHEREVER POSSIBLE! When designing your code generation templates, also keep the developer in mind who has to – at least to some extent – work with the generated code, for example When verifying the generator Or debugging the generated code Using this pattern helps to gain acceptance for code generation in general. Examples: Comments Use pretty printers/code formatters Location string („generated from model::xyz“)

Best Practices Domain Architecture Tools Process Multi Model C O N T E N T S Domain Architecture Domain Metamodelling Code Generation Tools Features And Structure An Example Process Multi Model Architecture and CBD Adopting MDSD Model-Driven Software Development www.mdsd-buch.de Best Practices

Tools: Overview Many kinds of tools can be used in the context of model driven development: UML modelling tools Metamodelling environments (XMI) Repositories Code Generators Model verifiers There is also a large amount of tools that are „MDA certified“. These range from completely integrated environments such as ArcStyler to simple code generators or technology specific generators (e.g. for J2EE).

Tools: Vendor Lock-in Because a lot of issues are not yet standardized, it is hard to integrate tools. Open issues include: Some XMI aspects Specification of model transformation rules Code generation ... As a consequence, integrated MDD/MDA tooling is currently impossible to achieve without vendor lock-in. Alternatively, building/integrating your own tooling based on open source can be done, but requires compromises. Many tools are exemplified in the context of code generation (see other presentation). Build Tools are also important. UML tools (such as Rational XDE) also develop in the direction of supporting MDA.

MOF Based Metamodelling, including OCL Tools: The Ideal One MOF Based Metamodelling, including OCL Usage of thses metamodels for subsequent modeling of M1 Metamodel specific repositoriy GUI adapted to metamodel Model Validation based on metamodel Also including OCL Transformation rules based on user-defined metamodels Flexible Code Generation Test support

Implement the Metamodel Implement the meta model in some tool that can read a model and check it against the meta model. This check needs to include everything including declared constraints. Make sure the model is only transformed if the model has been validated against the meta model. The meta model implementation is typically part of the transformation engine or code generator since a valid model is a precondition for successful transformation.

Ignore Concrete Syntax Define transformations based on the source and target meta models. The transformer uses a three phase approach: first parse the input model into some in-memory representation of the meta model (typically an object structure), then transforms the input model to the output model (still as an object structure) and finally unparse the target model to a concrete syntax

Transformations as first class citizens Transformations (and Templates) are central assets in MDSD. You should treat them accordingly. Transformations should be versioned. Refactor transformations to keep them current and well organized. Modularize transformations, e.g. using object-oriented concepts such as encapsulation, polymorphism, inheritance, etc.

Modular, Automated Transforms In order to more easily reuse parts of a transformation, it is a good idea to modularize a transform. Note that in contrast to the OMG, we do not recommend looking at, changing or marking the intermediate models. They are merely a standardized format for exchanging data among the transformations. Example: Multi-Step transformation from a banking-specific DSL to Java via J2EE

External Model Markings (AO-Modelling) In order to allow the transformation of a source model into a target model (or to generate code) it is sometimes necessary to provide “support” information that is specific to the target meta model. Example: Entity Bean vs. Type Manager Adding these to the source model “pollutes” the source model with concepts specific to the target model. MDA proposes to add “model markings”, but this currently supported well by only very few tools. Instead, we recommend keeping this information outside of the model (e.g. in an XML file); the transformation engine would use this auxiliary information when executing the transformations.

Best Practices Domain Architecture Tools Process Multi Model C O N T E N T S Domain Architecture Domain Metamodelling Code Generation Tools Features And Structure An Example Process Multi Model Architecture and CBD Adopting MDSD Model-Driven Software Development www.mdsd-buch.de Best Practices

Example Tool: openArchitectureWare Generator Open Source, quite active project http://www.openarchitectureware.org Core Features: Can Read any model (XMI from various UML tools, UML, textual, JDBC, Java classes …) Can generate any kind of output Explicit Domain-Metamodel (implemented in Java) Semi-Declarative Metamodel Constraints, „Functional Programming“ Simple, efficient template language Template Polymorphism and Template overwriting Multi-Model (Merging-Support)

Example Tool: openArchitectureWare Generator Core Features cont‘d: Inter-Model References among various model syntaxes (i.e. UML to XML) Support for Aspects in the metamodel and in the templates Arbitrary Namespace Models can be supported Plugin-Based Generator configuration (ant-based) Additional Features: Syntax-Highlighting Template Editor for Eclipse Metamodel can be generated from UML model, incl. DTD, HTML Docs, etc. Graphical GEF-Based Editors can be generated Dialog-Based Editors can be generated Framework for building IDEs based on this Generator Future Features EMF Integration, Visio Integration

Example Tool: openArchitectureWare Generator How it works:

Example Tool: openArchitectureWare Generator Usage Examples Web Development (J2EE, Servlets, Struts) Banking, Insurances Mobile Phone Software (C++ + QT, J2ME + Java) Embedded Software (C, CANbus, Osek) Automotive Component Middleware (Interactive) Web sites Architectural Management, „Entertainment) Multi-Platform Middleware (XML, C++, Java, …) Radioastronomy

Best Practices Domain Architecture Tools Process Multi Model C O N T E N T S Domain Architecture Domain Metamodelling Code Generation Tools Features And Structure An Example Process Multi Model Architecture and CBD Adopting MDSD Model-Driven Software Development www.mdsd-buch.de Best Practices

Defining DSLs is, however, something completely different: Teaming issues Using DSLs is not very different from “normal” programming – every developer can basically do it. Defining DSLs is, however, something completely different: Finding the „right“ abstractions, defining metamodels, keeping the various metalevels sorted, etc. is not everybody‘s business. Some of the tools to define metamodels, DSLs, generators and model-2-model transformations are not (yet) intuitively usable. Therefore I recommend to keep DSL/generator development to a limited group of people in your project.

Iterative Dual Track Development Develop Domain Architecture and at least one application at the same time. Establish rapid feedback from application developers to domain architecture developers. Develop both aspects iteratively and incrementally. Use strict timeboxing. Infrastructure develops iteration n+1 whereas application developers use iteration n. Introduce new Domain Architecture releases only at the beginning of iterations.

Extract the Infrastructure Before starting ITERATIVE DUAL-TRACK DEVELOPMENT, Extract the transformations from manually developed application. Either, start by developing this prototype conventionally, then build up the MDSD infrastructure based on this running application, Or extract the code from applications developed in the respective domain before doing MDSD (but only if the quality is sufficiently good!)

Best Practices Domain Architecture Tools Process Multi Model C O N T E N T S Domain Architecture Domain Metamodelling Code Generation Tools Features And Structure An Example Process Multi Model Architecture and CBD Adopting MDSD Model-Driven Software Development www.mdsd-buch.de Best Practices

Most systems can be structured into various One DSL is not enough Most systems can be structured into various partitions: functional subsystems subdomains: technical aspects It is hardly possible to describe each of these with the same DSL. You will need to come up with separate DSLs … that have to be „connectable“ in order to build the complete system

One DSL is not enough II - Example

Best Practices Domain Architecture Tools Process Multi Model C O N T E N T S Domain Architecture Domain Metamodelling Code Generation Tools Features And Structure An Example Process Multi Model Architecture and CBD Adopting MDSD Model-Driven Software Development www.mdsd-buch.de Best Practices

Rich Domain-Specific Platform Define a rich domain-specific application platform consisting of Libraries Frameworks base classes interpreters, etc. The transformations will “generate code” for this domain-specific application platform. As a consequence, the trans- formations become simpler. DSLs and Frameworks are two sides of the same coin

Software Architecture Process „on a slide“ …and actually, this is a talk of its own… Today‘s Problems: Too much technology Too many hypes and buzzwords Too many standards too early So: People don‘t focus on architectural concepts PHASE 1: Elaborate! Technology-Independent Architecture Programming Model Technology Mapping Mock Platform Vertical Prototype PHASE 2: Automate! Architecture Metamodel Glue Code Generation DSL-based Programming Model Model-based Architecture Validation

MDSD and CBD – the three viewpoints Type Model: Components, Interfaces, Data Types Composition Model: Instances, “Wirings” System Model: Nodes, Channels, Deployments

Component Implementation Component implementation should be based on notations specific to the “kind of component” Various other implementation stragies can be used, such as: Rule-Engines “Procedural” DSLs or action semantics Note that, here, interpreters can often be used sensibly instead of generating code!

Aspect Models Often, the described three viewpoints are not enough, additional aspects need to be described. These go into separate aspect models, each describing a well-defined aspect of the system. Each of them uses a suitable DSL/syntax The generator acts as a weaver Typical Examples are Persistence Security Forms, Layout, Pageflow Timing, QoS in General Packaging and Deployment Diagnostics and Monitoring

Best Practices Domain Architecture Tools Process Multi Model C O N T E N T S Domain Architecture Domain Metamodelling Code Generation Tools Features And Structure An Example Process Multi Model Architecture and CBD Adopting MDSD Model-Driven Software Development www.mdsd-buch.de Best Practices

Adopting MDSD – prerequisites Well-practices MDSD builds on several mature other practices, among them Well-defined software architecture Iterative software development and requirements management Mature project automation (regression testing, automatic builds, etc.)

Adopting MDSD – process

This automates many aspects of the technical aspects; Levels of MDSD You would typically start with architecture-centric MDSD where the abstractions of the DSL correspond to the core concepts of the technical platform. This automates many aspects of the technical aspects; Results in a wide platform/infrastructure Many projects can be handled with the infrastructure In later phases, functional MDSD infrastructures will be built on this technical one, resulting in cascaded MDSD.

Levels of MDSD

Levels of MDSD III – M2M Transformations

Levels of MDSD III – M2M Transformations II

Levels of MDSD III – M2M Transformations III

PATTERN: DSL-based Programming Model

Questions? Domain Architecture Tools Process Testing Multi Model C O N T E N T S Domain Architecture Domain Metamodelling Code Generation Tools Features And Structure An Example Process Testing Multi Model Adopting MDSD Questions? The End.

Some advertisement  For those, who happen to speak (or rather, read) german: Völter, Stahl: Modellgetriebene Softwareentwicklung Technik, Engineering, Management dPunkt, 2005 www.mdsd-buch.de For all others: A updated translation is under way: Model-Driven Software Development, Wiley, Q2 2006 www.mdsd-book.org