15
Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

  • View
    217

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

Translation of UML/OCL

into BZPE format

TestUML Project – INTERREG III – Meeting 12/02/04

Page 2: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

Overview

Translated elements

Implementation

UML Class Diagram translation

OCL translation

Page 3: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

Overview

Translated elements

Implementation

UML Class Diagram translation

OCL translation

Page 4: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

Translated elements

UML : now : class, some stereotypes, attribute, operation, parameter, association, composition, generalization, role, multiplicity

later : association class, other stereotypes, visibility

OCL :now : boolean, integer, set

later : real, string, bag, sequence

Page 5: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

Meta-model

Page 6: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

Overview

Translated elements

Implementation

UML Class Diagram translation

OCL translation

Page 7: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

Implementation

APIs of Poseidon are used to get informations on UML models.

Impossible for OCL expressions :

OCL is written through Poseidon interface generation of a file containing OCL

addition of OCL into IDS

parsing and type checking

Page 8: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

Implementation(2)

modelling

UMLdiagram

use of Poseidon

APIs and JMI

model repository (MDR) based

on IDS meta-model

automatic generation

by JMI

XMI file based on the IDS

meta-model

translation of OCL and BZPE generation

BZP File

file containing

OCL constraints

Page 9: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

Overview

Translated elements

Implementation

UML Class Diagram translation

OCL translation

Page 10: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

UML Class Diagram translation

Reminder about BZPE syntax :

Based on 4 Prolog predicates:

specification(spec-name).

declaration(spec-name, data-kind, data-name, data-type).

operation(spec-name, operation-name).

predicat(spec-name, pred-kind, pred-id, predicate).

data-kind : static | variable | input(op-name) | ouput(op-name) | local(op-name)

data-type : atom | int | set(data-type) | pair(data-type,data-type)

pred-kind : static | invariant | initialisation | pre(op-name) | post(op-name)

Page 11: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

UML Class Diagram translation

Each class is translated into a specification

Another kind of specification, the model, manages links between classes

Each class attribute is translated into a function inside the specification.

Each class method is translated into a BZPE operation

Page 12: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

Example

DATEday: intmonth : intyear : intgetDay() : int

specification(Date).declaration(Date, static, all_instances, set(atom)).predicat(Date, static, 1, all_instances = {d1,..,dN}).declaration(Date, variable, instances, set(atom)).predicat(Date, invariant, 2, instances all_instances).

declaration(Date, variable, day, set(pair(atom,int))).predicat(Date, invariant, 3, day instances 0..256

Context Date::getDay():intpost: result = self.day

Context Date inv :day > 0 and day < 32

predicat(Date, invariant, 6, x. x instances day(x) > 0 & day(x) < 32).

operation(Date,getDay_void).declaration(Date, input(getDay_void), self, atom).declaration(Date, output(getDay_void), result, int).predicat(Date, pre(getDay_void), 4, self instances).predicat(Date, post(getDay_void), 5, result = day(self)).

Page 13: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

Overview

Translated elements

Implementation

UML Class Diagram translation

OCL translation

Page 14: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

OCL translation

Translation of set operators :

Page 15: Translation of UML/OCL into BZPE format TestUML Project – INTERREG III – Meeting 12/02/04

OCL translation

Translation of set iterators :

defintBzp is the intentional set definition