Institute for Software Integrated Systems Vanderbilt University Copyright © Vanderbilt University/ISIS 2008 Model Interpreters Janos Mathe based on Peter.

Slides:



Advertisements
Similar presentations
Comparison of Several Meta-modeling Tools 2 Yi Lu Computer Science Department McGill University
Advertisements

Composable Metamodeling Environment Akos Ledeczi Institute for Software Integrated Systems Vanderbilt University
ITEC200 – Week03 Inheritance and Class Hierarchies.
DISTRIBUTED CONSISTENCY MANAGEMENT IN A SINGLE ADDRESS SPACE DISTRIBUTED OPERATING SYSTEM Sombrero.
Institute For Software Integrated Systems Vanderbilt University Applications of Model Integrated Computing to The Synchronous Language Signal Ethan Jackson.
Aalborg Media Lab 21-Jun-15 Software Design Lecture 1 “ Introduction to Java and OOP”
Application architectures
Understanding Metamodels. Outline Understanding metamodels Applying reference models Fundamental metamodel for describing software components Content.
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
II. Middleware for Distributed Systems
Using the Vanderbilt Generic Modeling Environment (GME) to Address SOA QoS Sumant Tambe Graduate Intern, Applied Research, Telcordia Technologies Inc.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Introduction to Java.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
February Semantion Privately owned, founded in 2000 First commercial implementation of OASIS ebXML Registry and Repository.
A First Program Using C#
Programming Languages and Paradigms Object-Oriented Programming.
Introduction to .Net Framework
Zhonghua Qu and Ovidiu Daescu December 24, 2009 University of Texas at Dallas.
Prepared by: Sanaz Helmi Hoda Akbari Zahra Ahmadi Sharif University of Tech. Summer 2006 An Introduction to.
Co-design Environment for Secure Embedded Systems Matt Eby, Janos L. Mathe, Jan Werner, Gabor Karsai, Sandeep Neema, Janos Sztipanovits, Yuan Xue Institute.
Java Security Pingping Ma Nov 2 nd, Overview Platform Security Cryptography Authentication and Access Control Public Key Infrastructure (PKI)
What is MOF? The Meta Object Facility (MOF) specification provides a set of CORBA interfaces that can be used to define and manipulate a set of interoperable.
Programming Languages and Paradigms Object-Oriented Programming (Part II)
UDM An Infrastructure for Implementing Domain-Specific Modeling Languages Endre Magyari, Arpad Bakay, Andras Lang, Tamas Paka, Attila Vizhanyo, Aditya.
11 CORE Architecture Mauro Bruno, Monica Scannapieco, Carlo Vaccari, Giulia Vaste Antonino Virgillito, Diego Zardetto (Istat)
1 Schema Registries Steven Hughes, Lou Reich, Dan Crichton NASA 21 October 2015.
Selected Topics in Software Engineering - Distributed Software Development.
Institute for Software Integrated Systems Vanderbilt University Copyright © Vanderbilt University/ISIS 2007 GME Basics Janos Mathe Zoltán Molnár Help-desk:
Generative Programming. Automated Assembly Lines.
Slide title In CAPITALS 50 pt Slide subtitle 32 pt Model based development for the RUNES component middleware platform Gabor Batori
Shannon Hastings Multiscale Computing Laboratory Department of Biomedical Informatics.
H.323, IP Multicast Conferencing, And TAPI 3.0 Don Ryan Development Lead Windows Networking And Communications Microsoft Corporation.
Introduce Grid Service Authoring Toolkit Shannon Hastings, Scott Oster, Stephen Langella, David Ervin Ohio State University Software Research Institute.
Shravana Kumar Musunuri, Jimmy Mathews Advisors: Dr. Joseph Picone Dr. David Gao Powertrain Design Tools Project The GENERIC MODELING ENVIRONMENT (GME)
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Week III  Recap from Last Week Review Classes Review Domain Model for EU-Bid & EU-Lease Aggregation Example (Reservation) Attribute Properties.
Netprog: Corba Object Services1 CORBA 2.0 Object Services Ref: The Essential Distributed Objects Survival Guide: Orfali, Harky & Edwards.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Lecture 18: Object-Oriented Design
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
Institute for Software Integrated Systems Vanderbilt University On Metamodel Composition Akos Ledeczi, Greg Nordstrom, Gabor Karsai, Peter Volgyesi and.
.NET Mobile Application Development XML Web Services.
4 th Workshop for TAO and CIAO July 16, 2004 MOF-Compliant Modeling of Middleware Jeff Parsons & Matt Emerson ISIS Vanderbilt University Nashville, TN.
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
2) Database System Concepts and Architecture. Slide 2- 2 Outline Data Models and Their Categories Schemas, Instances, and States Three-Schema Architecture.
David Adams ATLAS ATLAS Distributed Analysis and proposal for ATLAS-LHCb system David Adams BNL March 22, 2004 ATLAS-LHCb-GANGA Meeting.
Architectural Mismatch: Why reuse is so hard? Garlan, Allen, Ockerbloom; 1994.
1 Copyright © 2008, Oracle. All rights reserved. Repository Basics.
ISC321 Database Systems I Chapter 2: Overview of Database Languages and Architectures Fall 2015 Dr. Abdullah Almutairi.
Databases and DBMSs Todd S. Bacastow January 2005.
Windows Programming Environments
Introduction to J2EE Architecture
CMPE419 Mobile Application Development
Ch > 28.4.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Chapter 2 Database Environment Pearson Education © 2009.
Applying Domain-Specific Modeling Languages to Develop DRE Systems
Data, Databases, and DBMSs
Analysis models and design models
Chapter 2 Database Environment Pearson Education © 2009.
Graphical Modeling of INFOD applications
Chapter 2 Database Environment Pearson Education © 2009.
CMPE419 Mobile Application Development
Plug-In Architecture Pattern
Software Architecture & Design
Presentation transcript:

Institute for Software Integrated Systems Vanderbilt University Copyright © Vanderbilt University/ISIS 2008 Model Interpreters Janos Mathe based on Peter Volgyesi’s slides Implementing model transformations via model interpretation

October 11, Why do we need model interpreters ?  The metamodel describes the (abstract) syntax of the domain  The GME modeler tool does not “understand” the domain but enforces the syntax  The domain developer needs to define semantics  Model interpreters (software plugins)  Model transformations (graph rewriting rules)  Semantic anchoring (rewriting rules to a well defined set of “semantic units”)

October 11, Model Interpreters Typical uses  Text file generation (special case of rewriting)  Source code  Configurations files  Documentation  Analysis & verification  Simulation  Model transformation & migration  Formal graph rewriting rules are preferred

October 11, Model Interpreters How do they work  The interpreter has (hard-coded) knowledge about the entities and relationships in the DSML  Custom classes/interfaces/types  The developer needs to keep the metamodel and the interpreter in sync  The modeler tool can invoke the interpreter  Upon user request  On internally generated events (eg. “new obect added”)  Context  The interpreter can traverse the model hierarchy,  or processes only the event context  Actions  Generates output (files, GUI windows, etc.)  Can veto the model modification (if triggered from event)  eg: constraint manager  Modifies the model

October 11, Model Interpreters in GME  Interpreter  DSML specific component  Invoked explicitly by the user  Most components fall into this category (eg.: MetaInterpreter)  Plug-in  Domain independent component  Invoked explicitly by the user  Eg.: Search plug-in, XML export/import  Add-on  DSML specific or domain independent component  Invoked on (model change) events  Eg.: Constraint Manager

Interfaces October 11, Generic API Generic API MGA DB MGA DB Specific API Specific API Specific API Specific API Specific API Specific API MGA DB MGA DB Interpreters BON2Extender, UDM COM, BON, BON2, JavaBON MGA DB MGA DB

October 11, GME Internals Storage Components DB File Core Storage COM MGAMeta Core COM MGA COMMeta COM GUI ViewBrowserInspectrXML Constraint Manager Add-ons Metainterpreter InterpretersPlug-ins

October 11, GME Internals  Territories  MGA library clients have at least one territory  Objects are automatically added to them  One object can belong to multiple territories  When the object changes those clients will be notified whose territory contains the object  Transactions  Consistent model database  Undo/Redo operations  Initiated within a territory

October 11, COM Interfaces Motivation  Problems with C++ at run-time  The “client” allocates the memory (new operator)  The application needs to be recompiled if the library changes  Name mangling is not standardized  The application needs to be compiled with the same compiler tools  Object life cycle management (new and delete operators)  Language interoperability  The original C++ object model is closed and most of the OOP concepts are killed by the compiler  NOTE: The root of the problem: the execution platform is not OO (answer: virtual machines in Java and.NET)  Distributed objects

October 11, COM Interfaces Implementation  Interfaces are defined in interface description files (.idl)  The IDL compiler generates C++ classes with virtual methods only  Library classes can “implement” these interfaces  Using multiple inheritance  Using aggregation  Library classes (COM objects) are created with factory methods exported from the library

October 11, COM Objects and Interfaces Example MgaModel IMgaModel 270B4F9A-B17C-11D3-9AD1-00AA00B6FE26 IMgaFCO 270B4F98-B17C-11D3-9AD1-00AA00B6FE26 IMgaObject 32D1F3A7-D276-11D3-9AD5-00AA00B6FE26 COM InterfacesCOM Object “Mga.MgaModel” 83BA3237-B758-11D3-ABAE Stored in the Windows Registry Used when a new object is requested Stored in the library code (class) Used when a new interface is requested IUnknown is always supported See the “Interfaces” folder in the GME program directory

October 11, Problems with COM  Steep learning curve  Error-prone low-level details  Eg.: COM strings (BSTR), output parameters, reference counting  However:  very efficient components (almost zero overhead)  some components (eg.: add-ons) can be implemented in raw COM only

October 11, High level interfaces  Builder Object Network (BON)  C++ classes (custom DSML specific classes can be defined)  The entire model hierarchy is created/duplicated in memory initially  Very limited model modification support  BON2 and MON  C++ classes and meta classes (custom DSML specific classes can be defined)  BON2 objects are created on-demand  Full support for modifying the GME model  JavaBON  Python, Visual Basic support  Basically raw COM with minimal infrastructure support

October 11, Meta Object Network  Programmatic access to the paradigm (abstract syntax)  Similar to the introspection/reflection APIs in OOP languages  Every object in BON2 has a reference to one of these classes  Wrapper classes around the Meta COM library  See: architecture diagram  The classes are defined in the “MON::” namespace

October 11, Meta Object Network Entities

October 11, Meta Object Network Relations

October 11, BON2  Layered architecture  COM layer (interface with Mga and Meta). Hidden from the developer  Implementation layer  High level API mapping to raw COM  Object caching  Eg.: “BON::FCOImpl”  Wrapper layer  The “real” API for the interpreter developer  Pointer-like interface (smart pointers)  Eg.: “BON::FCO”  Classes are defined in the “BON::” namespace

October 11, BON2 Wrapper Classes  Pointer interface  use “->” to access the contained (implementation class) method  Validity of the object  boolean (“!“) operators  Equality (between MGA objects)  “=“, “!=“ operators  Smart casting  The cast operation succeeds if the MGA object can be encapsulated with the target class

October 11, BON2 Implementation Classes  Objects are created on-demand and cached  Multiple wrapper objects can contain the same implementation object  Impl. objects are released if there is no reference to them from wrapper classes  Reference counting is automatic  Slight differences between add-ons and interpreters

October 11, BON2 Components  The interpreter is represented by “BON::Component”  The following methods need to be implemented  void Component::initialize( … )  void Component::finalize( … )  void Component::invokeEx( … )  Entry point for interpreters and plug-ins  void Component::globalEventPerformed( … )  void Component::objectEventPerformed( … )  “Entry point” for add-ons

FSM Example 1.Metamodel  Create an FSM metamodel using MetaGME 2.Models  Build FSMs (models) using the FSM metamodel 3.Interpreter  Translate FSM models to executable code 4.Execution of a model  Feed events to the FSM thus causing state changes October 11,

Creating an interpreter  Create, register  CreateNewComponent.exe at GME install dir  By default at C:\Program Files\GME\SDK  Implement  Use MS Visual Studio 2003/2005 to implement the interpreter logic  Run  Invoke the interpreter in GME by clicking on the dedicated button  Create executable  Take the generated C++ file and build it  DOS PROMPT> cl TestFSM.cpp  Execute  Run the generated TestFSM.exe file  Feed events (by typing “a” and hitting Enter), when finished type “exit” October 11,

FSM interpreter logic Start: Project root 1.Find FSM models 2.Iterate through FSMs a)Create and open source file in a specific folder b)Traverse FSM model and generate code c)Close file October 11,

October 11, BON2 Extension Classes  Extendable classes: FCO, Atom, Model, Connection, Set, Reference  Realizing a new implementation class class CustomImpl : public BON::ModelImpl { public: void initalize() { … } void finalize() { … } … };  Create a new wrapper class DECLARE_BONEXTENSION( BON::Model, CustomImpl, Custom ); IMPLEMENT_BONEXTENSION( Compound, “Compound” );

October 11, BON2 Extension Classes  Support for abstract base classes:  DECLARE_ABSTRACT_BONEXTENSION  IMPLEMENT_ABSTRACT_BONEXTENSION  Multiple inheritance:  DECLARE_BONEXTENSION2  DECLARE_BONEXTENSION3

October 11, Essential BON2 Classes

October 11, BON Extender  Automatically generates BON2 extension classes from the metamodel  For all (even abstract) classes  Container classes will have customized “get” methods for the contained roles  Connections will have specialized source and destination “get” methods  Customized “get” methods for attributes  User code is protected and preserved by special comments  “//BUP”  “//EUP”