Alf - OCL 2015

A division of Data Access Technologies, Inc.
Combining Alf and UML in Modeling Tools
Ed Seidewitz, Model Driven Solutions
Jérémie Tatibouet, CEA
28 September 2015
Foundational UML (fUML)
Foundational UML (fUML) is an executable subset of standard UML
that can be used to define, in an operational style, the structural
and behavioral semantics of systems.
1998 – Action Semantics for the UML RFP
2003 – UML 1.5 with action semantics formalized
2003 – UML 2.0 adopted
2005 – Semantics of a Foundational Subset for
Executable UML Models RFP
2008 – fUML 1.0 Beta (based on UML 2.2)
2010 – fUML 1.0 Formal (based on UML 2.3)
2012 – fUML 1.1 Formal (based on UML 2.4.1)
2015 – fUML 1.2 Beta (also based on UML 2.4.1)
28 September 2015
Page 2
fUML Scope
The semantics of fUML provide the foundation for formally
specifying the (execution) semantics of the rest of UML.
Some areas of UML (e.g., use case and requirements
models) may not be best formalized based on an
executable semantics foundation.
Composite
Structure
Semantics
Complete
Activity Model
Semantics
State Machine
Semantics
Interaction
Model
Semantics
NonExecutable
Model
Semantics
Foundational Semantics
Base Semantics
fUML operational semantics are
specified as an execution model
written in fUML itself.
The base semantics of the subset of
fUML used in the execution model are
specified using formal logic.
28 September 2015
Page 3
Action Language for fUML (Alf)
The Action Language for Foundational UML (Alf) is a textual
surface representation for UML modeling elements with the primary
purpose of acting as the surface notation for specifying executable
(fUML) behaviors within an overall graphical UML model, but which
also provides textual notation for structural modeling constructs.
2008 – Concrete Syntax for a UML Action Language RFP
2010 – Alf 1.0 Beta (based on UML 2.4 and fUML 1.0)
2013 – Alf 1.0.1 Formal (based on UML 2.4.1 and fUML 1.1)
28 September 2015
Page 4
Textual Modeling in Alf
package CustomerAccounts {
public class Customer {
public name : String;
}
public class Account {
public balance : Integer;
}
public assoc CustomerAccount {
public customer : Customer;
public accounts :
Account[*];
}
}
private import CustomerAccounts;
private import Alf::Library::PrimitiveBehaviors::IntegerFunctions::’+’;
activity SumBalances(in customer : Customer) : Integer {
return customer.accounts.balance->reduce ’+’;
}
myCustomer = Customer->select c (c.email == myCustomerEmail);
total = SumBalances(myCustomer);
28 September 2015
Page 5
Integrated Graphical and Textual Modeling
Specify the structural model
graphically in UML.
Specify the behavior of
operations textually using Alf
Add additional elements
textually.
28 September 2015
Page 6
Alf Implementation in Eclipse/Papyrus
Validation using OCLInEcore
constraints.
Parsing
Serialization
Alf2UML and UML2Alf
transformations using QVT.
28 September 2015
Page 7
Demo Example: Ordering
28 September 2015
Page 8
OrderLineItem – Textual View
28 September 2015
Page 9
OrderLineItem – getAmount operation
28 September 2015
Page 10
OrderLineItem – After compilation
28 September 2015
Page 11
OrderLineItem - Constructor
28 September 2015
Page 12
Order – Textual representation
28 September 2015
Page 13
Order – getAmount operation
28 September 2015
Page 14
testOrder – Simple test driver
28 September 2015
Page 15
Current Limitations and Future Work
• Alf source editing
– Auto-completion
– Cross-linking
– Refactoring
• Alf source-level debugging
• Persistence of Alf in the model
28 September 2015
Page 16