If you can't read please download the document
Upload
edward-willink
View
1.043
Download
2
Embed Size (px)
DESCRIPTION
Presentation at OCL 2011 Workshop
Citation preview
2. Overview
3. Library Concrete Syntax
Abstract Syntax
Library Content
Library Enhancement 4. Summary 5. Library Concrete Syntax : Problems
6. Library Concrete Syntax : Solution
7. Library Concrete Syntax : Validation 8. Library Concrete Syntax : Iterations 1
9. Library Concrete Syntax : Iterations 2
Lambdacontext-type(parameter-types) :return-type
Distinct declarations per iterator arity 10. Iterators ; Accumulator | Body 11. iterateis a regular iteration 12. Semantic Problems: Overloading
13. Overloading semantics is not specified by OCL
static analysis to determine operation signature 14. dynamic dispatch on actual type of object 15. Semantic Solutions: Overloading
16. OCL 2.3 - fundamental
17. Real::max(Real),Integer::max(Integer) ... self-variant overloading
single dynamic dispatch
19. Semantic Solutions: OclSelf
20. OclSelf- the type ofself
a pseudo-type or type template parameter
21. 'exists' solely in Library Concrete Syntax declarations 22. resolved to a true type in the Abstract Syntax
23. Abstract Syntax Problems: oclAsSet
let a:String =xxxinxxx ->notEmpty()
Ifxxxis non-null Abstract Syntax represents let a:String =xxxin Set{ xxx }->notEmpty()
let a:String =xxxin Set{}->notEmpty()
let a:String =xxxin invalid->notEmpty() 24. Abstract Syntax Solutions: oclAsSet 1 Introduce OclAny::oclAsSet() operation
let a:String =xxxinxxx. oclAsSet() ->notEmpty()
25. OclVoid::oclAsSet() returns Set{} 26. OclInvalid::oclAsSet() returns invalid library declaration: OclAny::oclAsSet() : Set
27. Abstract Syntax Solutions: oclAsSet 2
OclAny::oclAsSet() : Set
1->forAll(i : Integer | i = 0) 1 UnlimitedNatural .oclAsSet() Set ->forAll(i : Integer | i = 0) over UnlimitedNatural 28. Library Problems: oclAsType
OCL 2.0OclAny::oclAsType(OclType) : T
OCL 2.2OclAny::oclAsType(Classifier) : T
29. Classifier at different meta-level Attempts to define a non-reflective meta-type 30. Does OCL support Reflection?
31. Library Problems: oclType OCL 2.0Element::getMetaClass()
OCL 2.2OclAny::oclType() : Classifier
Does OCL support Reflection?
self.oclType().elementType.oclIsKindOf(CollectionType)
33. Library Solutions: oclAsType, oclTypeOclAny::oclAsType(Class) : T
OclAny::oclType() : Class
self.oclType().ownedAttribute
self.oclType().oclType().ownedAttribute
34. Not-new OCL Facilities
35. Reflection : oclType(), Class
Type-valued Expressions : Class
Templates/Generics
OclSelf
Lambda Types / Expressions
36. Summary
recognised concepts already in use
Introduced consistency
37. Comparable/Summable Provided a DSL
38. auto-generating specification 39. Library Problems: collect
40. cannot be modelled using simple templates OCL 2.0 Collection does not conform to OclAny
OCL 2.2 Collection conforms to OclAny
41. Library Solutions: collect
model collect / collectNested usefully Reconsider flattening collect
42. respecified to hide pragmatic nesting 43. untenable for heterogeneous collections 44. Background : Problems
45. OCL 2.0 split off from UML 2.0
QVT 1.0 reused OCL 2.0
OCL 2.2, 2.3 make minor improvments
46. UML-alignment 47. incomplete semantics 48. Background : Solutions
49. consumable by tools 50. auto-generated change documentation
51. Companion talk - the underlying models 52. Library Problems: allInstances Declared at different meta-level BooleanType:: allInstances() : Set(Boolean) VoidType::allInstances() : Set(OclVoid) InvalidType::allInstances() : Set(OclInvalid)
Enumeration::allInstances()-- set of literals
Classifier::allInstances() : Set(T)-- instances of self
53. Library Solutions: allInstances static Classifier::allInstances() : Set
54. Setmodels the return type static Enumeration::allInstances() : ...
55. Library Concrete Syntax : Implementation
56. body requires an OCL code generator 57. utility requires a good OCL code generator Optionally bind feature to an implementation
58. Abstract Syntax Problems : Iteration
59. An iteration can be invoked from the AS
An iteration is not modelled in the AS
60. Abstract Syntax Solutions : Iteration New: Iteration extends Operation New: LoopExp::referredIteration 61. Library Content: OCL 2.2 Collections Four unrelated concrete Collection Kinds.
62. incomplete/inconsistent OrderedSet definition 63. Library Content: B t tner CollectionsTwo pairs of unrelated concrete Collection Kinds.
64. OrderedSet is not a Set
65. Library Content: New CollectionsSet/OrderedSet commonality via abstract UniqueCollection
66. Library Solutions: oclAsType OclAny::oclAsType(Class) : T
67. Types conform to their Class