OCL Prime - PowerPoint PPT Presentation

1 / 41
About This Presentation
Title:

OCL Prime

Description:

A Simple UML-conformant Evolution Language. J rn Guy S ... JMI-Repository (Sun NetBeans MDR) Advantage: Adaptable to all MOF Models (including UML 2.0) ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 42
Provided by: jrng
Category:
Tags: ocl | netbeans | prime

less

Transcript and Presenter's Notes

Title: OCL Prime


1
OCL Prime
  • A Simple UML-conformant Evolution Language
  • Jörn Guy Süß
  • Computation and Information Structures, TU Berlin
  • CIS-AG
  • EN 719
  • November 21, 2009

2
OCL Prime Talk
3
Whats driving MDA?
4
Motivation
  • Enhance model based development
  • Allow maintenance of large models
  • MDA does not provide solution (yet)

???
5
Objectives
  • consistent model to model mapping
  • UML Conformity (to avoid Training)
  • Simplicity to allow Practice (KISS!)

ERR9437 GRGLHLZ Type Inference failed for assert
in p-gtq-gt!p!. Expression is non-strict. L23C12
Begin GRGLHLZ Define p quantor(alla).use\a.a-gt
isgreen\ With(p) Do End GRGLHLZ
6
Model2Model
  • UML Profiles OCL
  • Trigger for Evolution
  • Integrity Protection
  • Cycle Validate-Evolve-Validate
  • Validator

7
UML Profiles OCL Forward Process
Deductive
Analysis
. . .
A
A
Design
D
. . .
D
Profile consistency
Profile consistency
Creative
Code Doc.
. . .
C
C
Software
. . .
S
S
8
UML Profiles OCL Reverse Process
Deductive
Analysis
. . .
A
A
Design
D
. . .
D
Profile consistency
Profile consistency
Creative
Code Doc.
. . .
C
C
Software
. . .
S
S
9
Trigger for Evolution
Deductive
Analysis
. . .
A
A
PreconditionTrue?
Design
D
. . .
D
Profile consistency
Profile consistency
Creative
Code Doc.
. . .
C
C
Software
. . .
S
S
10
Cycle Validate-Evolve-Validate
Deductive
Analysis
. . .
A
A
Manipulation
Design
D
. . .
D
Profile consistency
Profile consistency
Creative
Code Doc.
. . .
C
C
Software
. . .
S
S
11
Profile Validator Activity
Deductive
Analysis
. . .
A
A
Manipulation
Profile 2 constraints
Design
D
. . .
D
Profile 1 constraints
Profile consistency
Profile consistency
Creative
UML constraints
Code Doc.
. . .
C
C
Software
. . .
S
S
12
Implementation Options
13
Model Scripting Host
  • High Flexibility
  • "Pure" Component Integration
  • Large Number of Components
  • Low Component Reliability
  • "Non-existent" user community
  • "Strong reject"

14
Document Transformation
  • Few Well-Standardized Components
  • "Purely" functional programs
  • XMI is graph, not tree
  • Horrific programming
  • Small user community
  • "Weak reject"

XSLT
XMI
XMI
15
OCL extended for Manipulation
  • OCL is part of standard
  • Approch accepted in community
  • Only small extensions required
  • Some components available
  • OCL is ugly/wordy language
  • "Weak accept"

16
OCL Prime
  • Name First Derivative (time)
  • 90 OCL for Selection
  • 10 SQL-DML for Manipulation
  • Transactional
  • Adaptable to all MOF Models (UML 2.0)

17
Selection
  • (Multiple) assignment Expressions using "let
    in"
  • No Time-Expressions (Pre, Post)
  • No Feature-Calls (side-effect-free methods)

18
Manipulation
  • INSERT adds model elements by Value Assigns
    values from literals or variables
  • UPDATE changes model elements / relations by
    reference Cannot alter Identity
  • DELETE Drops model elements by identity Can
    affect several classes of the meta-model
  • Values OCL Types
  • Targets OCL-Path-Names

19
Values
  • Basic (Literal)
  • Element Reference (Collection/Navigation)
  • Collections Homogenous / Heterogenous (Elements
    of one/several Classes)All Homogenous
    Collections Reduce to Sets

20
Transactionality
  • Several Transactions in a file
  • Transactions may be hierarchical
  • Transaction must provide timeout
  • Closures "While Precondition holds do" ...
  • Closures run to completion

21
Implementation Idea
  • OCL-Interpreter
  • JMI-Repository
  • Attributed Graph Grammar System (AGG)

22
(No Transcript)
23
(No Transcript)
24
(No Transcript)
25
  • letExpression "let" ltnamegt ( " pathTypeName
    )? "" expression "in"
  • expression letExpression logicalExpression
  • ifExpression "if" expression "then" expression
    "else" expression "endif"
  • logicalExpression relationalExpression (
    logicalOperator relationalExpression )
  • relationalExpression additiveExpression (
    relationalOperator additiveExpression )?
  • additiveExpression multiplicativeExpression (
    addOperator multiplicativeExpression )
  • multiplicativeExpression unaryExpression (
    multiplyOperator unaryExpression )
  • unaryExpression ( unaryOperator
    postfixExpression ) postfixExpression
  • postfixExpression primaryExpression ( ("."
    "-gt") featureCall )
  • primaryExpression literalCollection literal
    pathName "(" expression ")" ifExpression
  • literal ltstringgt ltnumbergt "" ltnamegt
  • enumerationType "enum" "" "" ltnamegt ( ","
    "" ltnamegt ) ""
  • literalCollection collectionKind ""
    expressionListOrRange? ""
  • expressionListOrRange expression ( ( ","
    expression ) ( ".." expression ) )?
  • featureCall pathName
  • pathTypeName lttypeNamegt ( "" lttypeNamegt )
  • pathName ( lttypeNamegt ltnamegt ) ( "" (
    lttypeNamegt ltnamegt ) )
  • logicalOperator "and" "or" "xor"
    "implies"
  • collectionKind "Set" "Bag" "Sequence"
    "Collection"

26
Use of Graph Grammars
ltltcompgtgtCalc
PIM
ltltEJBgtgtCalc
PSM
27
Use of Graph Grammars
ltltcompgtgtCalc
PIM
ltltEJBgtgtCalc
PSM
28
Use of Graph Grammars Host Graph
Oid 1
Select Name C Type CompCalc
Oid 2
Oid 3
Oid 4
29
Use of Graph Grammars Rule LHS / RHS
Select Name C Type CompCalc
Name X
Name X Type Remote
Select Name C Type CompCalc
Name X
Name X Type Home
30
Open Issues
  • Type Checking
  • Compexity of AGG-Connector
  • Closure Operation Useful?

31
Forward Reverse Process
Deductive
Analysis
. . .
A
A
Design
D
. . .
D
Profile consistency
Profile consistency
Creative
Code Doc.
. . .
C
C
Software
. . .
S
S
32
OCL Prime
  • A Simple UML-Conformant Evolution Language
  • Jörn Guy Süß
  • Computation and Information Structures, TU Berlin
  • Dissertations-Kolleg
  • FhG ISST, Berlin
  • November 21, 2009

33
A Method in UML Defining Domain Stereotypes
UML
Node
UseCase
Class
Component
34
A Method in UML Defining Constraints
UML
Node
UseCase
Class
Component
Class 1 If a Class is concrete, all the
Operations of the Class should have a realizing
Method in the full descriptor. not
self.isAbstract implies self.allOperations-gt
forAll (op self.allMethods-gtexists (m
m.specification-gtincludes(op)))
35
A Method in UML Defining Transformations
UML
Node
UseCase
Class
Component
36
Queries, Views and Transformations in UML
  • Motivation Semi-Automatic Maintenance of large
    OO-Models? Enable MDATM Transformation is
    currently undefined!OMG has begun defining QVT
    in MOF 2.0, but ... ? Proposed languages lack
    usability
  • Objectives Allow consistent Model-to-Model
    mappingReuse common standards - minimize
    trainingKeep solution open to UML 2.0 and
    MOFProvide formal language model

37
OCL Prime - A QVT Language
  • Name From First Derivative in Physics (Time)
  • Languages used 90 OCL for Selection 10
    SQL-DML for Manipulation Graph-Grammars or Set
    Theory considered as Foundation
  • Components used OCL-Interpreter (TU
    Dresden) AGG-Toolkit (TU Berlin) or
    JDBC/SQL-Engine JMI-Repository (Sun NetBeans
    MDR)
  • Advantage Adaptable to all MOF Models (including
    UML 2.0)

38
A Working Example inspired by Jansson95
Task Create Interfaces for all Use Cases that do
not have Extension Points and Stereotype them as
Boundary

39
A Working Example inspired by Jansson95
Task Create Interfaces for all Use Cases that do
not have Extension Points and Stereotype them as
Boundary
package example context UseCase def let
ucsNonExtSet(UseCase) self.allInstances-gtsele
ct(uc uc.extensionPoint-gtsize() 0) let
stBoundaryStereotype Stereotype.allInstances-
gtselect(st st.Name "Boundary") endpackage
INSERT INTO Interface (Name) SELECT Name FROM
ucsNonExt UPDATE Interface SET stereotype
stBoundary WHERE Name In ucsNonExt.Name
OCL
SQL
40
Anatomy of OCLPrime Types / Selection
  • Based on OCL-Type System
  • ModelType (MM Class)
  • Basic (Literal) String, Real, Int, ...
  • Element Reference (Collection/Navigation)
  • Homogenous / Heterogenous Collections
  • Selection
  • (Multiple) assignment Expressions using "def" and
    "let in"
  • No Time-Expressions (Pre, Post)
  • No Feature-Calls (side-effect-free methods)

41
Anatomy of OCLPrime Manipulation
  • Manipulation
  • INSERT Adds model elements
  • UPDATE Changes model elements / relationsCannot
    alter Identity
  • DELETE Drops model elements by identityCan
    affect several classes of the meta-model
  • Targets OCL-Path-Names
  • WHERE Provides Equi-Join
  • Considerations
  • SELECT for reports
  • Transactions for Multi-User Repositories
  • Closures "While Precondition holds repeat this"

42
Transformation Pitfalls and the Validation Cycle
Deduction
Analysis
. . .
A
A
Manipulation
Design
D
. . .
D
MM consistency
MM consistency
Code Doc.
. . .
C
C
Software
. . .
S
S
43
Profile and Metamodel Consistency
Deduction
Analysis
. . .
A
A
Manipulation
Profile 2 constraints
Design
D
. . .
D
Profile 1 constraints
Profile(s) MM consistency
Profile(s) MM consistency
UML constraints
Code Doc.
. . .
C
C
Software
. . .
S
S
44
Application in Forward Reverse Processes
45
Status Progress of Dissertation
? Language 30 UML ProfileUse Cases, Message
Types, Simple Transformations ? Method 10 UP
for Messaging, QVT ? Tool(s) 40 EVE,OCL
Prime, ADAM ? Field Test 0 -
46
Current Implementation Status
  • Select OCL-Interpreter (TU Dresden)
  • ManipulationAttributed Graph Grammar System
    (AGG) (TU Berlin)Alternative JDBC-compliant
    RDBMS
  • Model JMI-Repository (NetBeans MDR)

47
Use of Graph Grammars in Implementation
LHS, Selecthere PIM
ltltcompgtgtCalc
RHS, Manipulationhere PSM
ltltEJBgtgtCalc
48
Model Scripting Host
  • High Flexibility
  • "Pure" Component Integration
  • Large Number of Components
  • Low Component Reliability
  • "Non-existent" user community
  • "Strong reject"

49
Document Transformation
  • Few Well-Standardized Components
  • "Purely" functional programs
  • XMI is graph, not tree
  • Horrific programming
  • Small user community
  • "Weak reject"

XSLT
XMI
XMI
50
OCL extended for Manipulation
  • OCL is part of standard
  • Approch accepted in community
  • Only small extensions required
  • Some components available
  • OCL is ugly/wordy language
  • "Weak accept"

51
(No Transcript)
52
(No Transcript)
53
(No Transcript)
54
  • letExpression "let" ltnamegt ( " pathTypeName
    )? "" expression "in"
  • expression letExpression logicalExpression
  • ifExpression "if" expression "then" expression
    "else" expression "endif"
  • logicalExpression relationalExpression (
    logicalOperator relationalExpression )
  • relationalExpression additiveExpression (
    relationalOperator additiveExpression )?
  • additiveExpression multiplicativeExpression (
    addOperator multiplicativeExpression )
  • multiplicativeExpression unaryExpression (
    multiplyOperator unaryExpression )
  • unaryExpression ( unaryOperator
    postfixExpression ) postfixExpression
  • postfixExpression primaryExpression ( ("."
    "-gt") featureCall )
  • primaryExpression literalCollection literal
    pathName "(" expression ")" ifExpression
  • literal ltstringgt ltnumbergt "" ltnamegt
  • enumerationType "enum" "" "" ltnamegt ( ","
    "" ltnamegt ) ""
  • literalCollection collectionKind ""
    expressionListOrRange? ""
  • expressionListOrRange expression ( ( ","
    expression ) ( ".." expression ) )?
  • featureCall pathName
  • pathTypeName lttypeNamegt ( "" lttypeNamegt )
  • pathName ( lttypeNamegt ltnamegt ) ( "" (
    lttypeNamegt ltnamegt ) )
  • logicalOperator "and" "or" "xor"
    "implies"
  • collectionKind "Set" "Bag" "Sequence"
    "Collection"

55
Why I do not use ObjectZ, Predicate Logic, etc.
Write a Comment
User Comments (0)
About PowerShow.com