Presentation is loading. Please wait.

Presentation is loading. Please wait.

MOF Meta-Models and UML Profiles

Similar presentations


Presentation on theme: "MOF Meta-Models and UML Profiles"— Presentation transcript:

1 MOF Meta-Models and UML Profiles
Jacques Robin

2 Outline MDA’s modeling level hierarchy Purposes of meta-models in MDA
Meta-Object Facility (MOF): a standard language for meta-modeling Modeling with software abstractions beyond UML UML Profiles KobrA-2 Multi-Agent Simulation

3 MDA’s Modeling Level Hierarchy
Meta- Meta-Model Level M3 MOF + OCL Meta-Model MOF + OCL Level M2 Model UML + OCL AND -OR UML Profile AND -OR Special Purpose Modeling Language Level M1 Running Application Level M0 Implementation Running on Platform

4 Example Meta-Model CMOF Meta-Model of Use-Cases (simplified)
inherits 1 .. * extends actor +name useCase +title system +name CMOF Meta-Model of Use-Cases (simplified) participates 0 ..* case 0 ..1 includes e-Store UML Model: Use-Case Diagram OrderItem ValidateCart

5 Example Meta-Meta-Model
parameter +direction attribute +name +multi CMOF Meta-Model of CMOF (Simplified) operation +name class +name associationEnd +name +multi package +name association +name inherits 1 .. * extends CMOF Meta-Model of UML Use-Cases (Simplified) actor +name useCase +title system +name participates 0 ..* case 0 ..1 includes

6 Purposes of Meta-Models in MDA
Define modeling languages Their abstract syntax Their formal semantics Define source and target anchors for model transformations What about APIs and Libraries? They are all written in a given language They are thus best viewed as built-in model elements to reuse than as part of a modeling language Thus they should be part of platform models, not of language meta-models

7 What is Meta-Modeling? Meta-Modeling vs. Modeling
Similar formalisms but different purposes One models applications and meta-models languages and formalisms Meta-Modeling vs. Ontology Engineering An ontology is a domain knowledge model, not a meta-model But a domain is an intermediate level of abstraction and generality between application and language Meta-Modeling Methodologies Uncharted territory Should integrate and reuse principles and techniques from: Application modeling (formalism similarities) Language design (purpose similarities) Ontology engineering (process similarities)

8 OMG’s Meta-Object Facility (MOF)
Key idea: Instead of defining entirely new languages for the M2 and M3 levels Reuse structural core of mature, well-known, well-tooled M1 level language (UML Infra-Structure) Advantages of MOF over traditional formalisms such as grammars to define languages: Abstract instead of concrete syntax (more synthetic) Visual notation instead of textual notation (clarity) Graph-based instead of tree-based (abstracts from any reader order) Entities (classes) have internal structure and behavior (strings do not) Relations include generalization and undirected associations instead of only order Specification reuse through inheritance Additional advantages with OCL: Allows expressing arbitrary complex constraints among language elements (more expressive) Allows defining formal semantics without mathematical syntax

9 MOF Meta-Model Package Structure
UML2 Infra-Structure MOF Meta-Model Package Structure MOF2

10 Essential MOF (EMOF) Meta-Model
Minimum bootstrap elements for modeling, meta-modeling and MDA tools Includes only classes, attributes, operations, packages and primitive types from UML2 Infra-Structure Does not includes associations, which are replaces by references (properties whose values are classes instead of primitive types) Any CMOF meta-model can be transformed into an EMOF meta-model EMOF extends UML2 Infra-Structure with elements to represent: Instances and their reflective relations with classes Language extension mechanisms

11 EMOF Meta-Model: Elements Reused from UML2 Infra

12 EMOF Meta-Model: Elements Reused from UML2 Infra

13 EMOF Meta-Model: Elements Absent from UML2 Infra
Reflection package: Views any model element as an instance of a meta-model meta-class Provide operations that cut across MDA layers to manipulate model and meta-model elements as meta-objects of their meta-classes Provides meta-meta-model of a generic reflective API to programmatically manipulate models

14 EMOF Meta-Model: Elements Absent from UML2 Infra
Extention package Any element can be tagged to extend modeling language vocabulary Identifiers package OID: class property with feature isID true Extent: OID value range useContainment: when true, all contained elements are added to containing element’s extents Elements(): returns extent members URIextent: extent where OIDs are URIs instead of properties

15 Example of EMOF Meta-Model
(simplified) Class Attribute Reference Actor +name: String +inherits: Actor +participates: UseCase UseCase +title: String +extends: UseCase +includes: UseCase EMOF Meta-Model of Use-Cases (simplified) System +name: String +case: UseCase e-Store UML Model: Use-Case Diagram OrderItem ValidateCart

16 Part of UML2 Infra-Structure Reused in CMOF but not in EMOF

17 Tailored Modeling with Software Abstractions Beyond UML
Software abstractions beyond UML can be classified as: Specializing UML abstractions (i.e., UML2 meta-model elements) Generalizing UML abstractions Being unrelated to UML abstractions Approaches: No MOF, no UML (the Microsoft way) Create and use domain-specific or even application-specific meta-modeling, modeling and model transformation languages Pure MOF, no UML: Create domain-specific or application-specific modeling language that does not reuse any UML meta-model element but is specified as a MOF meta-model MOF meta-model reuse operators applied to UML packages: Define MOF meta-model of new modeling language that reuses UML meta-model elements and add new ones UML Profile approach (the IBM way) Define specializations of UML abstractions by stereotyping UML meta-model elements Can be carried out as follows: Define MOF meta-model of new modeling language Associate every top-level element in this meta-model to a stereotype of some generalizing UML meta-model elements

18 Tailored Modeling: Domain-Specific Meta-Modeling and Modeling Approach
Advantage: Perhaps easier to integrate with Visual Studio? Drawbacks: For each new domain or application Need to redefine entire MDA language infra-structure alternative to OMG´s Need to implement CASE tools for non-standard languages D1, D2 Meta-Models in D2 GUI Editor for D2 Diagrams Model in Language D1 GUI Editor for D1 Diagrams D1 Model Repository

19 Tailored Modeling: Pure MOF Approach
Does not use UML Advantages: No need to artificially relate new abstractions to UML abstractions Drawbacks: Need to define entirely new meta-model that does not reuse any elements consolidated by OMG’s long meta-modeling experience Need to develop entirely new graphical notation and editors Need to develop all model manipulation services (code generation, test generation, reverse engineering) that UML CASE tools already provide D Meta-Model in MOF UML Editor Model in Dedicated Language D GUI Editor for D Diagrams EMF generates Menu Editor for D Diagrams

20 Tailored Modeling: Meta-Model and MOF Reuse Operators
Advantages: Reuses consolidated elements from UML2 meta-model Drawbacks: Need to extend UML’s graphical editors to draw elements in D – UML2 Need to extend model manipulation services (code generation, test generation, reverse engineering) of UML CASE to modeling elements in D – UML2 Current MOF operators do not cover UML2 concept generalizing reuse, only reuse “as is” or as specialization UML2 Meta-Model in MOF << reuse >> D Meta-Model in MOF UML Editor Model in Dedicated Language D GUI Editor for D Diagrams EMF generates Menu Editor for D Diagrams

21 Tailored Modeling: UML Profile Approach
UML2 meta-classes sub-categorized by stereotypes Sub-meta-class x stereotype: The instances of a sub-meta-class S of meta-class G are direct instances of S, not of G The instances of a meta-class G stereotyped by S are direct instances of G, for a stereotype has no proper instances Advantages: Maximum reuse the entire OMG language infra-structure Maximum reuse of UML CASE tools (no need to develop any new tool) Drawbacks: Risk to “artificially” recast modeling abstraction as specializations of UML ones Little to reuse for non-object oriented modeling languages UML2 Meta-Model in MOF EMF meta-class Package Class * * * Profile Stereotype ExtensionEnd Model in Dedicated UML2 Profile P Extension P UML2 Profile UML Editor * icon * ProfileApplication Image Property Association

22 Example Profile: KobrA-2 Component
Restricts UML2 meta-model to the subset of elements used as artifacts following the KobrA-2 methodology Goals of upgrading KobrA-1 into KobrA-2: Leverage latest MDA standards: UML2 (especially UML2 components), OCL2, MOF2, SPEM Extend process to PSM modeling and implementation Turn process more model-driven by: Clearly distinguishing between CIM and PIM Substitute all tabular natural language artifacts by OCL constraints and expressions Formalize process in SPEM Extend process with sub-steps dedicated to GUI development

23 KobrA-2 UML2 Profile K2CIMStructure K2StructureModel K2CIM
K2CIMBehavior K2PIMStructureSpecification K2PIMSpecification K2PIMBehaviorSpecification K2PIM K2PIMStructureRealization K2PIMRealization K2PIMBehaviorRealization nestedArtifact K2JPMSStructureSpecification Artifact KobrA2Component K2JPSMpecification K2JPSMBehaviorSpecification K2JavaPSM K2JPSMStructurelRealization K2JPSMRealization K2JPSMBehaviorRealization K2JavaCode K2BehaviorSpecificationModel KobrA-2 UML2 Profile K2BehaviorRealizationModel

24 KobrA-2 UML2 Profile 1..* K2StructureModel K2ClassDiagram 1..* * *
Component Class Association Dependency Interface 1..* Port Artifact Manifestation InstanceSpecification 1..* K2ObjectDiagram 0..* ComponentInstance Object Link Connector 1..* * * 1..* KobrA-2 UML2 Profile 1..* K2BehaviorSpecificationModel K2ContractConstraint Artifact Manifestation 0..* K2StateChart ProtocolStateMachine * K2BehaviorRealizationModel K2ActivityDiagram Activity 1..* * * Constraint Artifact Manifestation valueSpecification * K2SequenceDiagram Interaction OpaqueExpression * OpaqueBehavior ExpressionInOCL

25 MOF Meta-Model of a Simple Multi-Agent Simulations Modeling Language (MASML)
2..* Environment Agent Sensor Actuator 1..* Percept AgentAction ReasoningComponent Agent ReflexAgent ReflexComponent ReasoningComponent Sensor Actuator 1..* Agent AutomataAgent EnvironmentStateModel ModelInitializationComponent PercpetInterpretationComponent RamificationComponent ModelBasedBehaviorStrategyComponent ReasoningComponent Actuator Sensor 4..* 1..* AutomataAgent GoalBasedAgent Goal GoalInitializationComponent GoalUpdateComponent GoalBasedBehaviorStrategyComponent ReasoningComponent 3..* EnvironmentStateModel ModelBasedBehaviorStrategyComponent

26 MOF Meta-Model of a Simple Multi-Agent Simulations Modeling Language (MASML)
KBAgent ReflexAgent ReflexKBAgent ReflexKBComponent ReflexComponent KBAgent KBComponent PersistentKB ReflexKB context ReflexKBComponent inv Volat ileKB.isEmpty() 1..* Agent ReasoningComponent KnowledgeBase KBSentence 1..* KBAgent KBComponent PersistentKB VolatileKB 1..* 0..* GoalBasedKBAgent GoalBasedAgent KBComponent KBAgent GoalKB EnvironmentStateModelKB 6..* VolatileKB Goal EnvironmentStateModel 4 ..* 3 ..* AutomataKBAgent AutomataAgent KBComponent KBAgent EnvironmentStateModelKB 4..* VolatileKB EnvironmentStateModel 4 ..*

27 EnvironmentStateModel
UML2 Profile for MAS MASML Meta-Model UML2 Meta-Model MAS Component isActive = true Environment Agent ReasoningComponent Component Sensor Port Actuator Percept Signal AgentAction EnvironmentStateModel Model KnowledgeBase KBSentence

28 Available UML Profiles
By OMG: Enterprise Application Integration (application interoperability through standard metadata) Enterprise Distributed Object Computing (EDOC) QoS and Fault Tolerance Schedulability, Performance and Time Testing Third parties: Enterprise Java Beans (by Java Community Process) Software Services (by IBM, supported by Rational Software Architect UML CASE tool) Knowledge-Based Systems (University of York) Data Modeling (by agiledata.org) Framework Architectures (UML-F) Requirement Engineering with KAOS Formal Methods in B (UML-B) Embedded System Design


Download ppt "MOF Meta-Models and UML Profiles"

Similar presentations


Ads by Google