1 / 52

MDE standards

MDE standards. MOF. Meta Object Facility. MOF defines the language for defining modeling languages (meta-models) A meta-model defines concepts of the modeling language and their relationships (thanks to classes). A model is composed of model elements (that are instances of classes). MOF.

parker
Télécharger la présentation

MDE standards

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MDE standards

  2. MOF Meta Object Facility

  3. MOF defines the language for defining modeling languages (meta-models) A meta-model defines concepts of the modeling language and their relationships (thanks to classes). A model is composed of model elements (that are instances of classes). MOF UML Modèle Modèle Modèle UML UML What is MOF? Meta-meta-model Meta-model Model

  4. Class Diagram and meta-model • A class diagram represents a graph of connected classes and packages. • Classes are used to specify concepts of the modeling language • Packages are used to group classes • A meta-model is a set of packages • A meta-model is presented by a set of class diagrams

  5. Class • A class defines the common structure of a set of model elements (that are instances of the class). • A class : • Has a name • Contains attributes that specify the model element properties • Contains operations that specify the model element responsibilities (a model is productive) • Graphically, a class is a rectangle that contains a string (the name of the class). The rectangle can also be composed of three parts (name, attributes, operations).

  6. Attributes • Attribute syntax :visibility name : type • Visibility is: • ‘+’ public • ‘#’ protected • ‘-’ private • MOF defines its own primitive types • Integer, real, string, … • Attribute can be class level attribute, they are underlined. • Attribute can be derived, they are prefixed by ‘/’.

  7. Operations • Syntax: visibility name(parameter):return • Parameter syntax: kind name : type • kind: • in, out, inout • The MOF does not define any concept for specifying the behavior of an operation

  8. Inheritance • Inheritance between two classes means that sub class is more specific than the super class. • Multiple inheritance is allowed

  9. Associations • Associations connect two classes. • When two classes are associated, model elements instances of those classes can be linked. • One association is composed of two association ends. • Association end: • Has a name • A multiplicity (0, 1, *, 1..*, …) • An aggregation kind (composite, aggregate, none) • Other properties: Navigable, Changeable

  10. Associations A student attends at some courses. A student knows the courses he/she attends at. A course is attended by some students (0 or more).

  11. Packages • A package groups model elements • A package is a namespace • A package can import or merge other packages

  12. Example of meta-model

  13. The MOF itself • Everything is a model element • A namespace is a model element that contains model elements • A generalizable element is a namespace that can have a super type • A classifier is a generalizable element • A typed element has a type which is a classifier

  14. The MOF itself • Classes, associations and datatypes are classifier. • A typed element have a class, an association or a datatype as a type

  15. The MOF itself • Namespaces can own features (so classes and associations) • An association has two association ends! • References are structural feature that reference and expose association end.

  16. The MOF itself • Behavioral features are features that are also namespace • Operations and exception are behavioral features • Operation can raise exceptions.

  17. The MOF itself

  18. The MOF itself

  19. MOF2.0 = CMOF & EMOF • MOF2.0 defines two variants • EMOF (Essential) : Meta-models do not contain association (only references between classes). • CMOF (Complete) : Meta-models can contain associations. CMOF reuses EMOF

  20. MOF Synthesis • MOF fully formalize meta-model definition • MOF is OO, it eases meta-model reuse • MOF adds operations to meta-models in order to make them productive

  21. UML Unified Modeling Language

  22. UML defines concepts for building class diagrams MOF also defines concepts for building class diagrams => Capitalization of those concepts : UML2.0 Infrastructure MOF UML 2.0 Infrastructure/Superstructure UML Infra UML Super UML2.0 Infrastructure is not assigned to specific meta-layer.

  23. Behavior

  24. Action A pin is a typed element and multiplicity element that provides provide values to actions and accept result values from them.

  25. Action Actions for create or delete objects Actions for calling operations.

  26. Activity An activity is the specification of parameterized behavior as the coordinated sequencing of subordinate units whose individual elements are actions.

  27. Activity diagram « data store »

  28. State Machine • State machines can be used to express the behavior of part of a system. • Behavior is modeled as a traversal of a graph of state nodes interconnected by one or more joined transition arcs that are triggered by the dispatching of series of (event) occurrences. • A state machine owns one or more regions, which in turn own states and transition arcs.

  29. State Machine

  30. State & doActivity • An optional behavior that is executed while being in the state. The execution starts when this state is entered, and stops either by itself or when the state is exited whichever comes first.

  31. StateMachine Diagram

  32. Use Case

  33. And • Scenario • Component • Deployment • Collaboration • Template • Profile • UML-RT (UML for real time) • SysML (UML for system engineering) • …

  34. UML Synthesis • UML is the richer meta-model for modeling systems • The UML meta-model formalizes all concepts and their relationships • The notion of diagram is defined on top of the meta-model • A diagram is only a view on a UML model • UML tries to cover all preoccupations (static, dynamic, runtime, …) • UML can be extended dynamically (profile) or statically (extension of the meta-model)

  35. OCL Object Constraint Language

  36. OCL • OCL is a language for defining expressions on UML models • An OCL expression has no side effect on the UML model • The OCL language is defined by a meta-model • The OCL meta-model is linked to the UML meta-model • OCL also defines a concrete language (textual) that is based on top of the meta-model • OCL defines its own semantic thanks to UML models

  37. OCL Expression • An OCL expression is an expression that can be evaluated in a given environment. • Every OCL expression has a type that can be statically determined by analyzing the expression and its context. • Evaluation of an expression results in a value. Expressions with boolean result can be used as constraints. • The environment of an OCL expression defines what model elements are visible and can be referred to in an expression. The environment is defined by the ModelElement to which the OCL expression is attached.

  38. OCL Expression • A PropertyCallExp is an OCL expression that refers to a property (attribute or operation). Its result value is the evaluation of the corresponding property. • A ModelPropertyCallExp is a PropertyCallExp that refers to a classifier. • A VariableDeclaration declares a variable name and binds it to a type.

  39. ModelPropertyCallExp

  40. OCL Library • The OCL Library defines operations on primitive types • OclAny = (object2 : OclAny) : Boolean True if self is the same object as object2. • Real <= (r : Real) : Boolean True if self is less than or equal to r. • String, Interger, ... • Those operations can be called within OCL expression (ModelPropertyCallExp)

  41. OCL Syntax • The concrete syntax of OCL is described in the form of an a full attribute grammar. • Each production of the attribute grammar is linked to a element of the OCL meta-model. • The mapping from the concrete syntax to the meta-model is then fully formalized.

  42. OCL Semantic • The OCL semantic is fully defined thanks to UML models • The set of possible values that evaluations of expressions may yield is called the semantic domain • The semantic domain is described in the form of a UML package, containing a UML class diagram, classes, associations, and attributes. The real semantic domain is the (infinite) set of instances that can be created according to this class diagram. • The semantic of an OCL expression is given by association: each value defined in the semantic domain is associated with a type defined in the abstract syntax, each evaluation is associated with an expression from the abstract syntax.

  43. OCL and UML • OCL is bounded to UML1.4 • No alignment with UML2.0 and MOF2.0 • Whereas it is used to constraint meta-model!

  44. OCL Synthesis • OCL is really well defined • Abstract syntax • Concrete syntax • Semantic • OCL can be used to constrain UML models but also to query them • OCL should be updated (UML2.0 and MOF2.0) but nobody wants to do it

  45. MOF2.0 Q/V/T Quiery View Transformation

  46. QVT • QVT defines a standard language for modeling model transformations • QVT enables model transformations capitalization and productivity • After 5 years of work, QVT is a standard (October 2005)

  47. QVT approaches • QVT has a hybrid declarative/imperative nature. • A model transformation can be expressed as a set of relations (declarative) • A model transformation can be expressed as a set of operations (imperative). • Abstract and concrete syntax are provided for both approaches.

  48. Relations • A relation can be constrained by two sets of predicates, a when clause and a where clause. • The when clause specifies the conditions under which the relationship needs to hold. • The where clause specifies the condition that must be satisfied by all model elements participating in the relation. • A pattern is a set of variable declarations and predicates, which when evaluated in the context of a model, results in a set of bindings for the variables.

  49. Operations • An operational transformation represents the definition of a unidirectional transformation that is expressed imperatively. • It has a model signature indicating the models involved in the transformation. • It defines an entry operation, named main, which represents the initial code to be executed to perform the transformation.

  50. QVT Synthesis • QVT seems to be very powerful • But it is too young to clearly measure its advantages and drawbacks • No tool, no prototype • Always the same sample (UML 2 RDB)

More Related