Metamodeling. Janos Sztipanovits ISIS, Vanderbilt University

Similar documents
Ingegneria del Software Corso di Laurea in Informatica per il Management. Introduction to UML

COSC 3351 Software Design. An Introduction to UML (I)

UNIT-II Introduction to UML

Model Driven Development Unified Modeling Language (UML)

UNIT II. Syllabus. a. An Overview of the UML: Visualizing, Specifying, Constructing, Documenting

Metamodeling with Metamodels. Using. UML/MOF including OCL

Unified Modeling Language (UML)

OMG Modeling Glossary B

Metaprogrammable Toolkit for Model-Integrated Computing

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

Composite Structures

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

Towards Formalizing Domain-specific Modeling Languages. Kai Chen Janos Sztipanovits Sandeep Neema

SUMMARY: MODEL DRIVEN SECURITY

UML Modeling I. Instructor: Yongjie Zheng September 3, CS 490MT/5555 Software Methods and Tools

CHAPTER 1. Topic: UML Overview. CHAPTER 1: Topic 1. Topic: UML Overview

Outline. A little history. Outline. The Unified Modeling Language Opportunities and Challenges for Formal Methods

IDERA ER/Studio Software Architect Evaluation Guide. Version 16.5/2016+ Published February 2017

Appendix A - Glossary(of OO software term s)

Rubby Casallas Grupo de Construcción de Software Uniandes


AADL Graphical Editor Design

LABORATORY 1 REVISION

CISC836: Models in Software Development: Methods, Techniques and Tools

A UML 2 Profile for Variability Models and their Dependency to Business Processes

Plan. Language engineering and Domain Specific Languages. Language designer defines syntax. How to define language

Object Oriented Modeling

Unified Modeling Language 2

Language engineering and Domain Specific Languages

Unified Modeling Language (UML)

Model Querying with Graphical Notation of QVT Relations

Introduction to Software Engineering. 5. Modeling Objects and Classes

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

UML Fundamental. OutLine. NetFusion Tech. Co., Ltd. Jack Lee. Use-case diagram Class diagram Sequence diagram

Modeling with UML. (1) Use Case Diagram. (2) Class Diagram. (3) Interaction Diagram. (4) State Diagram

06. Analysis Modeling

For 100% Result Oriented IGNOU Coaching and Project Training Call CPD TM : ,

UML 2.0 UML 2.0. Scott Uk-Jin Lee. Division of Computer Science, College of Computing Hanyang University ERICA Campus

Index. business modeling syntax 181 business process modeling 57 business rule 40

Using UML To Define XML Document Types

OMG Specifications for Enterprise Interoperability

Teiid Designer User Guide 7.5.0

An Ontological Analysis of Metamodeling Languages

Object-Oriented Theories for Model Driven Architecture

Object-Oriented Analysis and Design. Pre-UML Situation. The Unified Modeling Language. Unification Efforts

Introduction to MDE and Model Transformation

Object-Oriented Systems Analysis and Design Using UML

METADATA INTERCHANGE IN SERVICE BASED ARCHITECTURE

Basic Structural Modeling. Copyright Joey Paquet,

A Solution Based on Modeling and Code Generation for Embedded Control System

VISUAL SPECIFICATION OF MODEL INTERPRETERS

Agenda. More on the Unified Modeling Language. UML diagram types. Packages

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico

UML 2.5: Specification Simplification

UML diagrams. Software artifacts include: SRS, SDS, test cases, source code, technical/user manual, software architecture, etc.

OCL Support in MOF Repositories

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

WHY WE NEED AN XML STANDARD FOR REPRESENTING BUSINESS RULES. Introduction. Production rules. Christian de Sainte Marie ILOG

Model-Driven QoS Provisioning Techniques for CCM DRE Systems

Object-Oriented Design

Contents Contents 1 Introduction Entity Types... 37

Introduction to UML What is UML? Motivations for UML Types of UML diagrams UML syntax Descriptions of the various diagram types Rational Rose (IBM.. M

UNIT I. 3. Write a short notes on process view of 4+1 architecture. 4. Why is object-oriented approach superior to procedural approach?

Software Architecture

ArchiMate 2.0. Structural Concepts Behavioral Concepts Informational Concepts. Business. Application. Technology

Index. Add Diagram > Sequence Diagram command,

From Models to Components. Rapid Service Creation with

Modelling in Enterprise Architecture. MSc Business Information Systems

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Compositional Model Based Software Development

Meta-Modeling and Modeling Languages

SLIDES: Introductory Modeling Example Employing UML and OCL [UML: Unified Modeling Language, OCL:Object Constarint Language]

Towards Two-Level Formal Modeling of Computer-Based Systems

An introduction to MOF MetaObject Facility.

Coral: A Metamodel Kernel for Transformation Engines

ATL TRANSFORMATION EXAMPLE

An Introduction to MDE

UML 2.0 Infrastructure Specification

MIDTERM EXAMINATION Spring 2010 CS403- Database Management Systems (Session - 4) Ref No: Time: 60 min Marks: 38

Oral Questions. Unit-1 Concepts. Oral Question/Assignment/Gate Question with Answer

UML 2.0 State Machines

CISC836: Models in Software Development: Methods, Techniques and Tools

Pattern for Structuring UML-Compatible Software Project Repositories

Object-Oriented Design

Sequence Diagram Generation with Model Transformation Technology

Object-Oriented Systems Development: Using the Unified Modeling Language

SOFTWARE ENGINEERING UML FUNDAMENTALS. Saulius Ragaišis.

From Objects to Aspects: Assessing Modularity Evolution

Softwaretechnik Model Driven Architecture Meta Modeling

NOTES ON OBJECT-ORIENTED MODELING AND DESIGN

Object-Oriented Software Engineering Practical Software Development using UML and Java

A MOF based Meta-Model and a Concrete DSL Syntax of IIS*Case PIM Concepts

Experiment no 4 Study of Class Diagram in Rational Rose

Software Service Engineering

The Object Model Overview. Contents. Section Title

Recalling the definition of design as set of models let's consider the modeling of some real software.

Activity Nets: A UML profile for modeling workflow and business processes

Chapter 4. Capturing the Requirements. 4th Edition. Shari L. Pfleeger Joanne M. Atlee

What is a Data Model?

Chapter 2: Entity-Relationship Model

Transcription:

Metamodeling Janos ISIS, Vanderbilt University janos.sztipanovits@vanderbilt.edusztipanovits@vanderbilt edu

Content Overview of Metamodeling Abstract Syntax Metamodeling Concepts Metamodeling languages UML Class Diagrams and OCL Meta-GME More Stuff on Metamodeling Standardization Trends ECLIPSE OMG

Domain Specific Modeling Languages L=<C C, A, S, M S, M C > Concepts Relations Well formed-ness rules Abstract Syntax A M S Semantic Mapping Semantic Domain S Mathematical abstraction for specifying the meaning of models Parsing M C Concrete Syntax C Notation for representing models

Concrete Syntax Notation for constructing and presenting models Textual syntax: uses structured text to represent models. Common approach in modeling languages is to use XML as a textual syntax. Visual syntax: represents the program diagrammatically.

Abstract Syntax Describes: the concepts of the modeling language relationships that may exists among the concepts well-formedness rules specifying how the concepts can be combined Abstract t syntax defines the set of syntactically correct models Abstract syntax is decoupled from concrete syntax and semantics but how to represent it?!

Semantics Semantics describes meaning of the model usually in terms of a mathematical domain. This mathematical domain is called semantic domain. The same model can be associated with different semantic domains. Mapping the concepts and relations of the abstract syntax to the semantic domain is part of the specification of the modeling language.

Metamodeling The metamodel is the model of the modeling language. Complete specification of a modeling language g includes all elements of L = < C, A, S, M S, M C > As a first step, we focus on C, A, M C. Most DSML specifications are limited to the abstract t syntax and concrete syntax metamodeling, we will discuss the metamodeling of semantics later.

Metamodeling Languages Meta-modeling language with well-defined semantics Abstract Syntax Parsing Semantic Mapping Concrete Syntax Semantic Domain? y Abstract Syntax DSML Represented by Meta-model Parsing Semantic Mapping Concrete Syntax Semantics Semantic Domain A metamodel is defined in a metamodeling language. The metamodeling language is designed to model Abstract Syntax: concepts, relations and well-formedness rules. We need a type-language with constraints and set- valued semantics.

Selection of a Metamodeling Language UML Class Diagram (UML-CD) and Object Constraint Language (OCL) Meta Object Facility (MOF) Several other alternatives but with the same set-valued semantics. metamodel S UML C UMLA DSML A M C M C A S DSML C

Why Do We Need Metamodel Architecture? Models written in a language are instances of the concepts defined in the metamodel; metamodels written in a metamodeling language are instances of concepts defined in the meta-metamodel. S UML M C C UMLA DSML metamodel A M C A S DSML C UMLA MOF meta-metamodel M C C UML metacircularity i A S

Traditional Metamodel Architecture Layers M0: Data in a model (e.g. parameters in a look-up table) M1: Model (e.g. model of a non-linear controller) M2: Metamodel of the modeling language (e.g. Look-up Table Class) M3: The properties of all metamodels (e.g. properties p of Classes)

Content Overview of Metamodeling Abstract Syntax Metamodeling Concepts Metamodeling languages UML Class Diagrams and OCL Meta-GME More Stuff on Metamodeling Standardization Trends ECLIPSE OMG

What is UML? The Unified Modeling Language (UML) is a standard language for specifying, visualizing, constructing, tin and documenting the artifacts ts of software systems, as well as for business modeling and other non-software systems. Main Goals of UML Provide users with a ready-to-use, expressive visual modeling language so they can develop and exchange meaningful models. Provide extensibility and specialization mechanisms to extend the core concepts. Be independent of particular programming languages and development processes. Support higher-level development concepts such as collaborations, frameworks, patterns and components.

UML History

UML 2.0 Infrastructure Core The core package is a complete metamodel. A metamodel is a model that defines the language for expressing a model. UML, CWM, MOF and Profile each depends on a common core. The profiles package defines the mechanism used to tailor existing metamodels towards specific platform, such as C++, CORBA, or EJB.

UML 2.0 Infrastructure Architecture: Four-Layer Metamodeling Hierarchy M3: Meta-metamodeling Layer Such as MOF M2: Metamodeling Layer Such as UML and CWM M1: Modeling Layer Such as Class Diagrams M0: Run-time Instances of Model Elements

UML Diagrams Static Structure Diagram Class Diagram Can be used for Package Diagram Metamodeling Object Diagram Behavior Diagram Activity Diagram Interaction Diagram State Machine Diagram Use Case Diagram Implementation Diagram Component Diagram Deployment Diagram Used for general modeling

UML Class Diagram Class Diagram A diagram that shows a collection of static model elements, such as classes, types, and their contents and relationships. Main Modeling Constructs in Class Diagrams Classes and their structure t and operations Association, aggregation, composition and generalization relationships Multiplicity and navigation indicators Role names

Classes Classifier A collection of instances that have something in common. Class A classifier that describes of a set of objects that share the same specifications of features, constraints, and semantics. Instances of classes are called objects. Attribute A structural feature of a classifier that characterizes instances of the classifier. Operation A feature which declares a service that can be performed by instances of the classifier of which they are instances. Value An element of a type domain.

Associations An association specifies a semantic relationship that may occur between instances of classifiers. Instances of associations are called links.

N-ary Associations An association among three or more classes. The arity of an association is the number of objects that participate p in each occurrence of the association.

Association: Multiplicity Constraints A specification of the range of allowable cardinalities that a set may assume. A multiplicity is a (possible infinite) subset of the non-negative integers.

Association Classes An association class is a modeling element that has both association and class properties. An association that also has class properties, or a class that also has association properties. An association class is depicted by an association symbol (a line) and a class symbol (a box) connected with a dash line.

Aggregation Aggregation is a special form of association that specifies a part-whole relationship between the aggregate (whole) and a component nt part. The aggregation relationship is transitive and antisymmetric across all aggregation links. A part can belong to more than one aggregate, and it may exist independently of the aggregate.

Composition A composition is a form of aggregation with strong ownership and coincident lifetime of parts with whole. A composition requires that a part instance be included in at most one composite at a time. The composite object is responsible for the creation and destruction of parts.

Generalization A generalization is a taxonomic relationship between a more general classifier and a more specific classifier. A specific classifier inherits all properties of the more general classifier. Specialization is performed by adding extra properties to a specific classifier.

Constraints A constraint is a condition that has to be satisfied by any correct implementation of a design. The formal constrains can be written in OCL, the Object Constraint Language (developed by IBM).

Object Constraint Language (OCL) OCL is a formal language used to describe expressions on UML models. Developed as a business modeling language with IBM Insurance division. OCL provides a way to develop more precise models using UML. To specify invariant conditions that must be hold for the system being modeled. To specify application-specific constraints in models. To specify queries on the UML model. To specify pre- and post conditions on Operations and Methods. To specify Guards.

Main Features OCL is a pure specification language and easy to read and write. OCL expression is guaranteed to have no side effects. OCL expressions are not by definition directly executable. OCL is a typed language. Each Classifier defined within a UML model represents a distinct OCL type. The evaluations of an OCL expression is instantaneous.

Basic Types & Operations Boolean and, or, xor, not, implies, if-then-else else Integer *, +, -, /, abs() Real *, +, -, /, floor() String concat(), size(), substring()

Objects, Self & Navigation OCL expressions can refer to Classifiers in UML class diagrams. Such as classes, interfaces, associations and datatypes. Self is a OCL reserved word to refer to the classifier instance. OCL expressions can navigate UML class diagrams. Invariants on Attribute: context Person inv: self.age() > 0 Navigation to Association Class: context Person inv: self.emplyeeranking[bosses]->sum() > 0

OCL Collection Collection is an abstract type. It has three collection types: Set Bag In a set, each element may occur only once. In a bag, elements may be present more than once. Sequence Sequence is a bag in which elements are ordered. OCL allows you to treat any instance like a collection. You can ask if a single attribute is empty.

Collection Operations Select Operations Example: Specify a invariant that all employee in a company older than 50 years is not empty. context Company inv: self.employee->select(age>50)->noempty() l l t () ForAll Operations context Company inv: self.employee->forall( age <= 65 ) Exists Operation context Company inv: self.employee->exist(p:person p.forname = Jack )

References UML 2.0 Infrastructure Final Adopted Specification, OMG adopted specifications, ptc/03-09-15, http://www.omg.org/cgi org/cgi-bin/doc?ptc/2003-09-15 09 15. UML 2.0 Superstructure FTF Convenience Specification, OMG adopted specifications, ptc/04-10-02, 02, http://www.omg.org/cgi-bin/doc?ptc/2004-10- 02. UML 2.0 OCL Final Adopted Specification, OMG adopted specifications, ptc/03-10-14, 14, http://www.omg.org/cgi-bin/doc?ptc/2003-10-14. Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process, C. Larman, 2 nd Edition, Prentice Hall, 2001.

Content Overview of Metamodeling Abstract Syntax Metamodeling Concepts Metamodeling languages UML Class Diagrams and OCL Meta-GME More Stuff on Metamodeling Standardization Trends ECLIPSE OMG

Metamodeling Architecture

GME and MetaGME Meta-programmable modeling tool Platform for the development of many model-based embedded systems tools Includes a metamodeling language with roots which predate MOF: MetaGME MetaGMET 1,GME/Meta : MetaGME A DSML GME/Meta A DSML

MetaGME Based on UML Class Diagrams and OCL Class Stereotypes imply part of the syntax of elements in the metamodel: : Compositional containers : Primitive objects : Pointers to model objects : Membership-based groupings : Relationships with object identity : Logical visual partitions of a system

GME/Meta FCOs (First-Class Objects) are classes which must be abstract but can serve as the base type of a class of any other stereotype in an relationship. For example, Atoms may only inherit from other Atoms and FCOs, but a particular FCO might serve as the base type of both Atoms and Models. Models are composite classes. An attribute on the Containment connection allows users to specify whether a given component type is graphically exposed by its containing Model type as a port. Atoms are elementary, non-composite classes. Sets are classes which group other classes together using a special meta-level relationship which captures the semantics of UML non-composite aggregation. References are classes that refer (through a special meta-level relationship) to other classes. Connections are analogous to UML association classes. Aspects are classes which group other classes together (through a special meta-level relationship) into logical visibility partitions to present different views of a model.

GME Metamodeling Environment The GME tool suite uses the same editor for editing metamodels as for editing domain models This is because the metamodeling environment is just a domain modeling language in the Metamodeling domain In fact, the metamodeling environment was generated from its own metamodel, known as the meta-metamodel metamodeling Domain metamodel Generates domain modeling Domain Models

GME Metamodeling Environment + Now in GME it is possible to import metamodels into the metamodeling environment, and combine them using the composition operators This allows metamodel reuse, facilitated by the fact that the metamodeling environment is a full fledged d domain environment Also, extending the metamodels leaves the originals intact, while the extensions reflect changes to the originals when they take place

Content Overview of Metamodeling Abstract Syntax Metamodeling Concepts Metamodeling languages UML Class Diagrams and OCL Meta-GME More Stuff on Metamodeling Standardization Trends ECLIPSE OMG

Changing Them What if you hate MetaGME and love MOF?

Composing Them Composition allows metamodels to contain other metamodels This allows a metamodeler to take advantage of existing metamodels Metamodeling development time is decreased Systems may be independently developed, and later brought together Other features of the composable metamodeling environment allow for models describing similar systems to be brought together in a common modeling environment

Composing Them But How? How is composition accomplished? UML containment and inheritance are used to describe the relationships of domain entity types, not of the metamodeling entities. In other words, it is difficult to customize the metamodeling constructs in terms of other metamodeling constructs. Thus, UML was extended to include new operators to express the relationships between metamodeling constructs.

Composition Operators: Union Light Gates The Union operator This operator describes a full union of two UML classes. All attributes and capabilities are combined into one class, thus creating a domain entity that is the union of two domain entities Example A tire manufacturer gauges its plant output with light gates (for height of tire stack) and sonic detectors (for width of tire, to determine tire type). The data from these actuators are coalesced, and interpreted by two different computers. Modeling these two actuators as one could make data interpretation easier, by combining height and width into one class, rather than two Sonics Union

Composition Operators: Inheritance 1/2 Father Son Implementation Inheritance operator In this composition type, the child inherits all of the attributes of its parent, but receives only the associations where its parent is the container Example A man and his son exhibit Implementation Inheritance. The child gets the attributes of his father (e.g. same house, same looks), and will inherit the belongings owned ( contained ) by his father However, the child does not go to his father s job, although his father has an association with work.

Manager New Manager Composition Operators: Inheritance 2/2 Interface Inheritance operator The complement of Implementation Inheritance In this composition type, only the associations where its parent is NOT the container, and inherits no attributes whatsoever Example The new manager of a pro sports team gets Interface Inheritance from the previous manager. The new manager has the same responsibility as the old manager. However, he has different perks (attributes), and without the same respect from the players (container associations)

Illustrative DSML Example We have a Signal Flow (SF) environment (paradigm) with Compounds (which contain primitives) and Primitives (connected by I/O signals) whose behavior is specified by C code. We have a FSM paradigm with States connected by Transitions Now, we want to be able to express the behavior of Primitives using an FSM, instead of C code. We want to combine the two, resulting in: Primitive FSMNode that contains an FSM spec FSMNodes should contain States, but States should not contain FSMNodes FSMNodes can have I/O signals connecting it to States

Illustrative Example True UML Inheritance Implementation Inheritance Later

Illustrative Example

Content Overview of Metamodeling Abstract Syntax Metamodeling Concepts Metamodeling languages UML Class Diagrams and OCL Meta-GME More Stuff on Metamodeling Standardization Trends ECLIPSE OMG

Eclipse: Ecore Metamodel

Discussion Metamodeling means designing how we want to think about a system. How should we start the metamodeling process? What does it mean: the MOF Metamodel is a meta-metamodel. Why do we consider abstract syntax metamodeling as structural modeling? What is the semantics of structural modeling?

Additional comments

UML Activity Diagram A diagram that depict behavior using a control and data-flow model. Activity modeling emphasizes the sequence and conditions for coordinating lower-level behaviors, rather than which classifiers own those behaviors.

UML Interaction Diagrams Including several types of diagrams that emphasize object interactions. Sequence diagram Communication diagram Interaction overview diagram A sequence diagram example: Withdraw Cash

UML State Machine Diagrams A state machine diagram depicts discrete behavior modeled through finite state-transition systems. It specifies the sequence of states that an object or an interaction goes through during its life in response to events, together with its responses and actions.

UML Use Case Diagrams Use cases are a mean for specifying required usages of a system. A use case diagram is a diagram that shows the relationships among actors, the systems, and use cases.

UML Component Diagrams The component concept addresses the area of component-based development and componentbased system structuring. A component diagram shows the organizations and dependencies among components.

UML Deployment Diagrams A diagram that depicts the execution architecture of systems. It represents systems artifacts as nodes, which are connected through communication paths to create network systems. Nodes may represent either hardware devices or software execution environments.