Composable Code Generation Applied to MDA

Similar documents
MDD with OMG Standards MOF, OCL, QVT & Graph Transformations

Compositional Model Based Software Development

Model Driven Production of Domain-Specific Modeling Tools

Model-Based Techniques in the Development of Net-Centric Applications. Timothy A. Anderson Basil C. Krikeles. June 20, 2007

Applying UML Modeling and MDA to Real-Time Software Development

Second OMG Workshop on Web Services Modeling. Easy Development of Scalable Web Services Based on Model-Driven Process Management

Model Driven Architecture

Modelling in Enterprise Architecture. MSc Business Information Systems

Web Services Annotation and Reasoning

CODAGEN TECHNOLOGIES AND MODEL-DRIVEN ARCHITECTURE (MDA)

Developing Software Applications Using Middleware Infrastructure: Role Based and Coordination Component Framework Approach

MDA and Integration of Legacy Systems: An Industrial Case Study

The Unified Modelling Language. Example Diagrams. Notation vs. Methodology. UML and Meta Modelling

QoS-aware model-driven SOA using SoaML

xuml, AADL and Beyond

Component Design. Systems Engineering BSc Course. Budapest University of Technology and Economics Department of Measurement and Information Systems

Methods for the Development

Research on Semantics implementation method of domain specific modeling language of air-combat decision behavior based on Python.

An Introduction to MDE

* Corresponding Author

AADL Graphical Editor Design

FUSED Framework for System Engineering Hands-on Tutorial SAE AADL 19 April 2012

NoMagic Product Comparison Brief

BLU AGE 2009 Edition Agile Model Transformation

How to Harvest Reusable Components in Existing Software. Nikolai Mansurov Chief Scientist & Architect

An Open Source Domain-Specific Tools Framework to Support Model Driven Development of OSS

Chapter 5 System modeling

Basic Object-Orientation

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University

security model. The framework allowed for quickly creating applications that examine nancial data stored in a database. The applications that are gene

Automation of Semantic Web based Digital Library using Unified Modeling Language Minal Bhise 1 1

From Object Composition to Model Transformation with the MDA

Small is Beautiful Building a flexible software factory using small DSLs and Small Models

Developing Rich Internet Applications Using Microsoft Silverlight 4

Computation Independent Model (CIM): Platform Independent Model (PIM): Platform Specific Model (PSM): Implementation Specific Model (ISM):

developer.* The Independent Magazine for Software Professionals

MDA, META-MODELLING and MODEL TRANSFORMATION. Introducing new Technology into the Defence Industry

Improving Military Information Technology Through Common Conceptual Models

Model Driven Engineering (MDE)

Model Driven Architecture - The Vision

CSE 70 Final Exam Fall 2009

Model Driven Development Unified Modeling Language (UML)

Current trends and frameworks for modeldriven approaches to software development

The Generic Modeling Environment

02291: System Integration

Reengineering of Distributed Middleware Systems To a Model Driven Architecture (MDA)

Model-Driven QoS Provisioning Techniques for CCM DRE Systems

GMF Tooling 3.0 Vision, Architecture, Roadmap

Practical Model-Driven Development with the IBM Software Development Platform

CSSE 490 Model-Based Software Engineering: Software Factories

Reusable Object-Oriented Model

Model driven Engineering & Model driven Architecture

Role of Executable UML in MDA. Presented by Shahid Alam

METADATA INTERCHANGE IN SERVICE BASED ARCHITECTURE

All you need are models Anneke Kleppe, Klasse Objecten

J2EEML: Applying Model Driven Development to Autonomic Enterprise Java Bean Systems

Executive Summary. Round Trip Engineering of Space Systems. Change Log. Executive Summary. Visas

Metamodeling. Janos Sztipanovits ISIS, Vanderbilt University

Metamodeling with Metamodels. Using. UML/MOF including OCL

Model Driven Development of Component Centric Applications

Beyond CSE143. What s Left To Do? Templates. Using Templates. A Template Class. A Problem with Reusing Code CSE 143

Execution of UML models Present and Future of Research and Practice

What is Metamodeling and Code Generation All About

Report Documentation Page

1 Executive Overview The Benefits and Objectives of BPDM

From MDD back to basic: Building DRE systems

Weapon Systems Open Architecture Overview

An Information Model for High-Integrity Real Time Systems

Actor-Oriented Design: Concurrent Models as Programs

A Model Driven Approach based on Interaction Flow Modeling Language to Generate Rich Internet Applications

Meeting the Challenges of Ultra-Large

LEARN TO DEVELOP A LIVE PROJECT AS PER IT STANDARDS. Module 1: What we are going to Learn. Prerequisites

bahmanzamani.com Computer Engineering i Dept. University of Isfahan

Architecture Modeling in embedded systems

UML 2.0 State Machines

2015 Ed-Fi Alliance Summit Austin Texas, October 12-14, It all adds up Ed-Fi Alliance

Hybrid Agent-Landscape Model Composition

A Domain-Specific Language for Modeling Web User Interactions with a Model Driven Approach

Model Driven Development. Building Automated Code Generation Methods with Eclipse and DSL Tools. Vicente Pelechano

Losing Control: Controls, Risks, Governance, and Stewardship of Enterprise Data

Interoperability and Semantics in Use- Application of UML, XMI and MDA to Precision Medicine and Cancer Research

Basic Properties of Styles

Platform modeling and allocation

Pattern-Based Analysis of an Embedded Real-Time System Architecture

Investigation of System Timing Concerns in Embedded Systems: Tool-based Analysis of AADL Models

ADT: Eclipse development tools for ATL

Master of Science Thesis. Modeling deployment and allocation in the Progress IDE

Dialogue Notations and Design

ASSURING DATA INTEROPERABILITY THROUGH THE USE OF FORMAL MODELS OF VISA PAYMENT MESSAGES (Category: Practice-Oriented Paper)

Automatic Code Generation for Non-Functional Aspects in the CORBALC Component Model

A Case-Based Behavior Design Aid for OneSAF

FEASIBILITY of the MDA APPROACH in UCE projects

CSCU9T4: Managing Information

Executable UML the silver bullet or maybe not Dr. Joel Henry October 22, 2008

IoT Standards Ecosystem, What s new?

Object-Oriented Theories for Model Driven Architecture

The Design Patterns Matrix From Analysis to Implementation

Domain Models for Laboratory Integration

Minsoo Ryu. College of Information and Communications Hanyang University.

Sub- PPL Unit-I Class-SE Comp

Transcription:

Composable Code Generation Applied to MDA Kirk Schloegel, David Oglesby, Eric Engstrom MDA Implementers Workshop December 2-5, 2003 Work is supported by a grant from DARPA.

Agenda Modeling, Meta-modeling, and Code Generation Composable Code Generation Experimental Results Application to MDA 2

Software engineering productivity growth Software engineering productivity is growing at a good rate (~14% per year) 9 Lines of code (normalized) 8 7 6 5 4 3 2 1 1990 1991 1992 1993 1994 1995 Software Productivity Sources: US Dept. of Labor, Bureau of Labor Statistics, Center for Management of Technology and Entrepreneurship, University of Toronto. 3

Embedded software complexity growth Complexity of embedded software seems to be growing at a faster rate! 9 Lines of code (normalized) 8 7 6 5 4 3 2 1 1990 1991 1992 1993 1994 1995 Satelite (on Board) Satelite (Ground) Fighter Avionics Ground Radar Software Productivity Sources: US Dept. of Labor, Bureau of Labor Statistics, Center for Management of Technology and Entrepreneurship, University of Toronto. 4

Honeywell s response (10+ years ago) Honeywell has a rich portfolio of embedded system products Thermostats & Home Security (small scale) Flight Management & Guidance Systems (mid scale) Industrial Controls (large scale) Real-time & Safety Critical! Honeywell Labs responded to these trends in the early 90s In a manner that looks a lot like MDA applied to embedded systems Use of domain-specific modeling tools to generate code Petri Nets (PIM) to systems of equations (PSM) Hardware architectures (PIM) to HDLs (PSM) Coad-Yourdon diagrams (PIM) to Ada specification files (PSM) Many notations (PIM) to documentation (PSM) Humans are the platform Problem: developing domain-specific modeling tools is costly What about a tool for developing tools? Meta-models (PIM) to domain-specific modeling tools (PSM) 5

DOME Domain Modeling Environment Rapid development and customization of domain-specific modeling tools! Model GUIs Analysis Domain Model Domain Model Auto Doc Auto Code Powerful scripting language for implementing constraints and semantics! Auto Test COTS-tool-based artifact generation environment! 6

That was 10 years ago In the meantime, many other meta-modeling tools have been developed GME (Vanderbilt), MetaEdit (MetaCase Consulting) At Honeywell, a lot of work has gone into using meta-modeling to develop domain-specific modeling notations and tools Recently (~2001-2003) We participated in DARPA s MoBIES program with the goal to extend DOME s capabilities. 7

DARPA MoBIES Program Description MoBIES is developing interoperable tools to design and test complex computer-based systems such as avionics, weapons, and communications systems. These tools will simplify the design of complex embedded systems by focusing on the pre-production environment rather than after-the-fact integration. The approach is to customize the design tools used by applications engineers so that controller design and systems integration can be more fully automated and the errors thereby reduced. 8

Honeywell s Challenges in the MoBIES Program Create/customize a high-level design tool comprised of multiple integrated modeling notations/views Enable distributed and real-time embedded designs to be specified by systems of disparate, yet interacting, models Generation of middleware configuration code (PSM) and tool interchange data (PSM) from Event flow models (PIM), Process-thread-component maps, Hardware models Enable model reuse Specifically, enable the capture and reuse of design patterns as modeling constructs 9

Code Generation Challenges Generate code cooperatively across modeling notations Domain-specific modeling notations have few, deep concepts They are not usually extensible The data required to generate code is not specified in any one notation Generate to Interchange Formats (IF) Data formats that have been agreed upon by all participants Sometimes the necessary data is not specified in any of the models Both the modeling environment and the IFs are (rapidly) evolving Requires an agile code generation framework Code Generator Evolving! 10

CCG -- Key idea Current model-based code generators Monolithic programs that are external to the modeling tool A dual hierarchy typically results Composable Code Generation (CCG) A framework for adding automation to domain-specific modeling tools The key idea is that CCG applies object-oriented programming techniques to code generation Modeling entities are like objects, each has a meta-entity (i.e., similar to a class) A natural message to pass to a modeling entity is provide your Java code generator Entity-specific code generators can be attached to the meta-data that define specific types of modeling entities. 11

Dual hierarchy example Meta-model Class Operation Parameter Attribute A m1() m2() B int a C m3() m4() Instance model Code generator for-each (class) { for-each (attribute) { } for-each (operation) { for-each (parameter) { } } The looping structure of the code generator depends upon the compositional structure of the modeling domain. 12

Composable code generation /* classes generate */ /* attributes generate */ /* operations generate */ Meta-model Class Operation Attribute A m1() m2() B /* parameters generate */ Parameter C m4() int a m3() Instance model 13

Generator specialization Meta-models are models If you can attach generators to entities in meta-models, can you also attach them to entities in other types of models? Yes What about to collections of entities? Yes What about dynamically assigning generators based on model and/or entity properties? Yes Given these capabilities, collisions can occur The most specific generator is typically selected from a set We refer to this as generator specialization 14

Generator specialization example /* classes generate */ /* attributes generate */ /* operations generate */ /* do something specific to C */ Meta-model Class Operation Attribute A m1() m2() B D <<Interface>> /* parameters generate */ Parameter C <<Interface>> m4() int a m3() m5() Instance model /* do something specific to Interfaces */ 15

Cross-domain specialization /* classes generate */ /* attributes generate */ /* operations generate */ Meta-model Class Operation Attribute A m1() m2() B /* parameters generate */ Parameter C m4() int a m3() /* get the next most specific generator and execute it. */ /* do something else */ Instance model CPU 1 CPU 2 CPU 3 All operations that execute on AES Technology this CPU Centers of Excellence AES 16

Multi-tool cooperative code generation /* classes generate */ /* attributes generate */ /* operations generate */ Meta-model Class Operation Attribute A m1() m2() B /* parameters generate */ Parameter C m4() int a m3() Instance model /* run a script that: (i) loads a specified model into Simulink / RTW, (ii) generates code from this tool, and (iii) returns the behavioral code. */ 17

MoBIES Results We developed a multi-model design capability for an open experimental platform based upon a jet fighter weapon & navigation system Our design environment generated XML code for middleware configuration import into event-dependency and timing analysis tools We wrote 35 CCG code generation routines in support of these requirements Average length: 51 lines Min length: 6 lines Max length: 199 lines Generated code from mid-sized models (hundreds of entities) 18

Application to MDA (1) Model Type Mappings Model types (meta-entities define model types) can have type-specific generators that specify how they map to types in different notations. These can be keyed to properties META-ENTITY for a UML class Class isabstract? If (this.isabstract?) CreateInterface(this); else CreateClass(this); 19

Application to MDA (1) Model Instance Mappings Model instances can have instance-specific generators that specify how they map to different notations Instances of UML classes Robot DustBot If (this.isabstract?) abort(-1); else CreateClass(this); 20

Application to MDA (1) MDA notions Marks Marks are essentially property definitions. These define name-type pairs and are specified on the meta-entity. Modeling entities have values for these. e.g., All entities of type Polygon have the property Number of sides of type integer. Instances of type Polygon have a value for this property. Marking Models Additional properties (aka marks) can be assigned to entity types from outside of their meta-models using the Further defines [1] cross-domain relationship. Generators can be selected dynamically by model and instance properties. A Objects are linked to processors Object Processor executeson C m4() m1() m2() B int a m3() CPU 1 CPU 2 CPU 3 [1] K. Schloegel, D. Oglesby, E. Engstrom, D. Bhatt. A New Approach to Capture Multi-model Interactions in Support of Cross-domain Analyses, 2001. 21

Application to MDA (2) MDA notions Templates Any entity-specific generator Model Merging Traversal of models and generation of code from multiple notations is supported This capability was crucial for the code generated under the MoBIES program Additional Information Additional data for code generation can be imported dynamically from external tools and models, user input, or may be specified statically (i.e., hardcoded) in generators Patterns We have developed a mechanism for the capture and reuse of design patterns that we refer to as archetypes [2]. Archetypes can have their own archetype-specific generators that override base generators [2] D. Oglesby, K. Schloegel, D. Bhatt, and E. Engstrom. A Pattern-based Framework to Address Abstraction, Reuse, and Cross-domain Aspects in Domain Specific Visual Languages. In Proc. of OOPSLA 2001, 2001. 22

DOME is publicly available and open source We are currently working on porting (and extending) DOME to Java http://www.htc.honeywell.com/dome/ 23