SlideShare uma empresa Scribd logo
1 de 65
19 March 2018
Copyright © 2018 Model Driven Solutions, Inc.
Programming in UML:
An Introduction to fUML and Alf
Updated for fUML 1.3 and Alf 1.1
Page 2
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Agenda
I. Introduction
II. Elements of Executable UML
III. Standard Model Library
Page 3
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
I. Introduction
A. A Motivating Example
B. Executable UML
C. The Standards
Page 4
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
A. A Motivating Example
• E-Commerce Ordering System
– Loosely based on the Online Bookstore Domain Case Study given
in Appendix B of the book Executable UML: A Foundation for Model
Driven Architecture by Stephen J. Mellor and Marc J. Balcer
(Addison-Wesley, 2002)
• To be designed in UML
– Class models for structure
– State machine models for behavior
• To be implemented on the Web
– Using Java/JEE
– …or maybe C#/.Net
– …or maybe LAMP
– …or whatever…
Page 5
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Ordering: Class Model
Order is an active class
whose classifier behavior
is responsible for handling
ordering functionality.
Order is an active class
whose classifier behavior
is responsible for handling
ordering functionality.
Page 6
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Order: Classifier Behavior
A state machine abstracts
system behavior into a
finite number of states.
A state machine abstracts
system behavior into a
finite number of states.
The system is modeled as
having discrete transitions
between the states.
The system is modeled as
having discrete transitions
between the states.
A transition may trigger
further system behavior or
system behavior may be
dependent on the current
state.
A transition may trigger
further system behavior or
system behavior may be
dependent on the current
state.
Page 7
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Order Behavior: EstablishCustomer Activity
An activity specifies
behavior as the
coordinated
execution of a set of
subordinate actions.
An activity specifies
behavior as the
coordinated
execution of a set of
subordinate actions.
An action in one
activity may call
another activity.
An action in one
activity may call
another activity.
Data and control
flow between the
various actions.
Data and control
flow between the
various actions.
Other actions provide
various data and
computational functions.
Other actions provide
various data and
computational functions.
Full executability requires
complete specification of
behavior and computation. This
is often much more easy to
specify using a textual notation.
Full executability requires
complete specification of
behavior and computation. This
is often much more easy to
specify using a textual notation.
Page 8
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
The Question Is…
• If we are going to take the time to carefully design our system
using UML, e.g.,
– Structural models of classes and associations
– Behavioral models using state machines or operations and messages
• Then why can’t we use these directly to execute our system?
The answer is: We can!
• Just add detailed behavior…
– …which is best done using a textual action language…
– …which should be at the same semantic level as the rest of the model.
Page 9
B. Executable UML: Perceived Issues
• Making models detailed enough for machine execution defeats
the purpose of models for human communication.
• UML is not specified precisely enough to be executed (at least
not in a standard way).
• Graphical modeling notations are not good for detailed
programming.
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Page 10
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Executable UML: Issue Resolutions
• Making models detailed enough for machine execution defeats
the purpose of models for human communication.
– Executable models can still be more understandable than
executable code.
– Non-executable models are still useful, too.
• UML is not specified precisely enough to be executed (at least
not in a standard way).
– The Foundational UML (fUML) standard specifies precise
semantics for an executable subset of UML.
– fUML Version 1.0 formal specification now available.
• Graphical modeling notations are not good for detailed
programming.
– The Action Language for fUML (Alf) standard specifies a
textual action language with fUML semantics.
– Alf Version 1.0 finalization in progress.
Page 11
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
C. The Standards
• Unified Modeling Language (UML)
• Executable UML Foundation (fUML)
• UML Action Language (Alf)
Page 12
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Unified Modeling Language (UML)
The Unified Modeling Language (UML) is a graphical language for
modeling the structure, behavior and interactions of software,
hardware and business systems, standardized by the Object
Management Group (OMG).
• UML Version 1.1 (first standard) – December 1997
• UML Version 1.5 (with action semantics) – March 2003
• UML Version 2.0 (new version) – July 2005
• UML Version 2.4.1 – July 2011
• UML Version 2.5 (spec simplification) – May 2015
• UML Version 2.5.1 (current standard) – December 2017
Page 13
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Executable UML Foundation (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.
• fUML Version 1.0 – January 2011
• fUML Version 1.1 – July 2013
• fUML Version 1.2.1 – December 2016
• fUML Version 1.3 (current standard) – October 2017
• fUML Version 1.4 (migration to UML 2.5.1) – 2018 (planned)
Page 14
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Key Components
• Foundational UML Subset (fUML) – A computationally
complete subset of the abstract syntax of UML (Version 2.4.1)
– Kernel – Basic object-oriented capabilities
– Common Behavior – General behavior and asynchronous
communication
– Activities – Activity modeling, including structured activities (but not
including variables, exceptions, swimlanes, streaming or other
“higher level” activity modeling)
• Execution Model – A model of the execution semantics of user
models within the fUML subset
• Foundational Model Library
– Primitive Types – Boolean, String, Integer, Real, Unlimited Natural
– Primitive Behaviors – Boolean, String and Arithmetic Functions
– Basic Input/Output – Based on the concept of “Channels”
Added in fUML
1.1
Added in fUML
1.1
Page 15
Other Precise Semantics Specifications
The following specifications build on the foundation of fUML:
•Precise Semantics of UML Composite Structure (PSCS)
– Version 1.1 (beta) – June 2017
•Precise Semantics of UML State Machines (PSCS)
– Version 1.0 (alpha) – December 2016 (in finalization)
•Precise Semantics of Time for Foundational UML
– RFP issued – December 2017
– Revised submissions due – August 2019
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Page 16
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
UML Action Language (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 an extended notation for
structural modeling within the fUML subset.)
• Alf Version 1.0 (beta) – November 2012
• Alf Version 1.0.1 (migration to fUML 1.1) – September 2013
• Alf Version 1.1 (current standard) – June 2017
• Alf Version 1.2 (migration to fUML 1.4) – 2018/2019 (planned)
Page 17
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Key Components
• Concrete Syntax – A BNF specification of the legal textual syntax
of the Alf language.
• Abstract Syntax – A MOF metamodel of the abstract syntax tree
that is synthesized during parsing of an Alf text, with additional
derived attributes and constraints that specify the static semantic
analysis of that text.
• Semantics – The semantics of Alf are defined by mapping the Alf
abstract syntax metamodel to the fUML abstract syntax metamodel.
• Standard Model Library
– From the fUML Foundational Model Library
• Primitive Types (plus Natural and Bit String)
• Primitive Behaviors (plus Bit String Functions and Sequence Functions)
• Basic Input/Output
– Collection Functions – Similar to OCL collection operations for
sequences
– Collection Classes – Set, Ordered Set, Bag, List, Queue, Deque, Map
Page 18
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
II. Elements of Executable UML
A. Activities
B. Actions
C. Structure
D. Asynchronous Communication
Page 19
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
A. Activities
• Activities and Parameters
• Actions and Flows
• Textual Notation
• Tokens
• Offers
• Control Nodes
• Structured Nodes
Page 20
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Activities and Parameters
An activity is a specification of behavior as
the coordinated execution of subordinate
actions, using a control and data flow
model.
An activity is a specification of behavior as
the coordinated execution of subordinate
actions, using a control and data flow
model.
An activity may have input,
output and return parameters.
An activity may have input,
output and return parameters.
The parameters have corresponding activity
parameter node on the boundary of the
diagrammatic representation of an activity.
The parameters have corresponding activity
parameter node on the boundary of the
diagrammatic representation of an activity.
Page 21
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Actions and Flows
An action is a fundamental
unit of executable behavior
within an activity.
An action is a fundamental
unit of executable behavior
within an activity.
A pin is an activity node that
either accepts input to or
provides output from an action.
A pin is an activity node that
either accepts input to or
provides output from an action.
An object flow provides
a path for passing
objects or data.
An object flow provides
a path for passing
objects or data.
A control flow specifies
the sequencing of
actions.
A control flow specifies
the sequencing of
actions.
An activity diagram is a graph structure
consisting of activity nodes connected by
activity edges.
An activity diagram is a graph structure
consisting of activity nodes connected by
activity edges.
Page 22
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Textual Notation
activity DoSomething(in input: Integer, out output Integer): Integer {
output = A(input);
return B();
}
activity DoSomething(in input: Integer, out output Integer): Integer {
output = A(input);
return B();
}
Alf behavioral notation
maps to fUML activity
models.
Alf behavioral notation
maps to fUML activity
models.
The semantics of the Alf notation
is defined by its mapping to
fUML
The semantics of the Alf notation
is defined by its mapping to
fUML
Page 23
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Tokens
a = DoSomething(1, b);a = DoSomething(1, b);
A token is a container for an object, datum
or locus of control that may be present at an
activity node.
A token is a container for an object, datum
or locus of control that may be present at an
activity node.
The activity is invoked
with an argument of 1
for its input parameter.
The activity is invoked
with an argument of 1
for its input parameter.
An object token with a
value of 1 is placed on
the input activity
parameter node.
An object token with a
value of 1 is placed on
the input activity
parameter node.
The object token flows to
the input pin of action A
along the object flow.
The object token flows to
the input pin of action A
along the object flow.
Action A fires and
produces an object
token on its output pin.
Action A fires and
produces an object
token on its output pin.
The object token flows
to the output activity
parameter node along
the object flow.
The object token flows
to the output activity
parameter node along
the object flow.
When it is done, action A
produces a control token,
which flows to action B
along the control flow.
When it is done, action A
produces a control token,
which flows to action B
along the control flow.
Action B accepts the
control token and fires,
producing an object
token on its output pin.
Action B accepts the
control token and fires,
producing an object
token on its output pin.
The object token flows
to the output activity
parameter node along
the object flow.
The object token flows
to the output activity
parameter node along
the object flow.
Values on the output activity
parameter nodes are copied
to the output arguments.
Values on the output activity
parameter nodes are copied
to the output arguments.
Page 24
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Offers
An output pin offers its
tokens to the targets of
all outgoing object flows.
An output pin offers its
tokens to the targets of
all outgoing object flows.
A single token can only flow to one
target. If two competing targets are
both ready to accept an offer for the
same token, it is indeterminate
which will get the token.
A single token can only flow to one
target. If two competing targets are
both ready to accept an offer for the
same token, it is indeterminate
which will get the token.
Note: fUML semantics do not guarantee
“liveliness” or “fairness” in the execution of
actions competing for tokens.
Note: fUML semantics do not guarantee
“liveliness” or “fairness” in the execution of
actions competing for tokens.
Actions with no control constraints
execute concurrently. This means that
they may execute in parallel – or they
may execute sequentially in any order.
Actions with no control constraints
execute concurrently. This means that
they may execute in parallel – or they
may execute sequentially in any order.
Page 25
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Fork and Join Nodes
order = 'Create Order'();
//@parallel
{
'Fulfill Order'(order);
'Invoice Order'(order);
}
'Close Out Order'(order);
order = 'Create Order'();
//@parallel
{
'Fulfill Order'(order);
'Invoice Order'(order);
}
'Close Out Order'(order);
A fork node copies the
tokens it is offered,
and offers a copy on
each outgoing flow.
A fork node copies the
tokens it is offered,
and offers a copy on
each outgoing flow.
A join node waits for a token
to be offered on all incoming
flows and then offers tokens
on its outgoing flow.
A join node waits for a token
to be offered on all incoming
flows and then offers tokens
on its outgoing flow.
In the Alf textual notation,
forks and joins are implicit in
the parallel block notation.
In the Alf textual notation,
forks and joins are implicit in
the parallel block notation.
Note: Alf does not actually provide any
notation for competition for tokens on
output pins. A fork node is always inserted
for multiple flows out of any output pin.
Note: Alf does not actually provide any
notation for competition for tokens on
output pins. A fork node is always inserted
for multiple flows out of any output pin.
Page 26
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Control Nodes
An initial node
generates a single
control token.
An initial node
generates a single
control token.A merge node
passes on any
tokens it receives.
A merge node
passes on any
tokens it receives.
A decision node
routes tokens based
on a decision input
value.
A decision node
routes tokens based
on a decision input
value. An activity final
node terminates
the activity when it
receives a token.
An activity final
node terminates
the activity when it
receives a token.
A control node is an activity
node used to coordinate the
flow of (the offers for) tokens
between other nodes.
A control node is an activity
node used to coordinate the
flow of (the offers for) tokens
between other nodes.
Note: A data store node
is used so a “card”
token is available for
each iteration.
Note: A data store node
is used so a “card”
token is available for
each iteration.
Note: Since the decision
node “gates” control flow,
it must be provided with an
incoming control token.
Note: Since the decision
node “gates” control flow,
it must be provided with an
incoming control token.
Added in fUML
1.3
Added in fUML
1.3
Page 27
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Structured Nodes
card = 'Select Credit Card'();
do {
charge = 'Create Credit Card Charge'(card);
if ('Check Charge Approval'(charge)) {
'Notify Customer of Approval'(charge);
declined = false;
} else {
'Notify Customer of Denial'(charge);
declined = true;
}
} while (declined);
card = 'Select Credit Card'();
do {
charge = 'Create Credit Card Charge'(card);
if ('Check Charge Approval'(charge)) {
'Notify Customer of Approval'(charge);
declined = false;
} else {
'Notify Customer of Denial'(charge);
declined = true;
}
} while (declined);
A structured node is an activity
node used to group subordinate
nodes into a control structure.
A structured node is an activity
node used to group subordinate
nodes into a control structure.
An loop node iterates
the execution of its
body while a
condition is true.
An loop node iterates
the execution of its
body while a
condition is true.
By default, the
condition is tested
after execution of
the body.
By default, the
condition is tested
after execution of
the body.
A conditional node
executes one
clause or another
based on the result
of a test (or tests).
A conditional node
executes one
clause or another
based on the result
of a test (or tests).
Inputs to the loop node
initialize loop variables
available across all
iterations of the loop.
Inputs to the loop node
initialize loop variables
available across all
iterations of the loop.
Note: There is no normative UML
graphical notation for loop or
conditional nodes.
Note: There is no normative UML
graphical notation for loop or
conditional nodes.
break;
true
Alf also provides
a traditional
break statement.
Alf also provides
a traditional
break statement.
Page 28
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Expansion Regions
'Get Outstanding Orders'(customer) ->
select order ('Is Delinquent?'(order)) ->
iterate order ('Refer for Collection'(order));
'Get Outstanding Orders'(customer) ->
select order ('Is Delinquent?'(order)) ->
iterate order ('Refer for Collection'(order));
An expansion region is
used to apply subordinate
actions on all members of
an input collection
An expansion region is
used to apply subordinate
actions on all members of
an input collection
A parallel expansion
region applies nested
behavior concurrently
to all collection
elements.
A parallel expansion
region applies nested
behavior concurrently
to all collection
elements.
An iterative expansion
region applies nested
behavior sequentially
to all collection
elements.
An iterative expansion
region applies nested
behavior sequentially
to all collection
elements.
Alf provides specialized
notation that maps to typical
uses of expansion regions.
Alf provides specialized
notation that maps to typical
uses of expansion regions.
Page 29
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Reduction
A reduction action “inserts”
a binary function between
the elements of a
sequence of values.
A reduction action “inserts”
a binary function between
the elements of a
sequence of values.
this.totalAmount =
this.lineItems.amount->reduce MoneyFunctions::Add;
this.totalAmount =
this.lineItems.amount->reduce MoneyFunctions::Add;
this.totalAmount =
this.lineItems.amount->reduce MoneyFunctions::Add
?? new Money(0, 0);
this.totalAmount =
this.lineItems.amount->reduce MoneyFunctions::Add
?? new Money(0, 0);
This is shorthand for
“this.lineItems->collect item (item.amount)”.
This is shorthand for
“this.lineItems->collect item (item.amount)”.
If the input sequence is empty, then
reduction results in “null” (the empty
sequence). An Alf null-coalescing
expression can be used to provide a
default value for this case. (Corresponding
UML not shown.)
If the input sequence is empty, then
reduction results in “null” (the empty
sequence). An Alf null-coalescing
expression can be used to provide a
default value for this case. (Corresponding
UML not shown.)
Page 30
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
B. Actions
• Invocation Actions
• Object Actions
• Structural Feature Actions
• Link Actions
NOTE: Some of these actions will be discussed in more detail later.NOTE: Some of these actions will be discussed in more detail later.
Page 31
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Invocation Actions
• Call Behavior
– Calling an activity
– Calling a primitive behavior
• Call Operation
• Send Signal
• Accept Event
PlaceOrder(customer, product)
Max(throttle, limit) count + quantity
order.addProduct(product, quantity)
vehicle.EngageBrake(pressure)
accept (signal: EngageBrake)
Page 32
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Object Actions
• Value Specification
• Create Object
• Destroy Object
• Test Identity
• Read Self
• Read Extent
• Read Is Classified Object
• Reclassify Object
1 true "Hello"
new Order()
order.destroy()
order == myOrder name != customerName
this
Order.allInstances()
vehicle instanceof Car car hastype Hatchback
reclassify order from PendingOrder to ClosedOrder
Page 33
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Structural Feature Actions
• Read Structural Feature
• Add Structural Feature Value
• Remove Structural Feature Value
• Clear Structural Feature Value
order.customer
order.datePlaced = today
order.lineItems->add(item)
order.lineItems->addAt(1,item)
order.lineItems->remove(item)
order.lineItems->removeAt(1)
order.card = null
Page 34
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Link Actions
• Read Link
• Create Link
• Destroy Link
• Clear Association
Owns.person(house=>thisHouse) thisHouse.person
Owns.addLink(person=>jack, house=>newHouse)
Owns.removeLink(person=>jack, house=>oldHouse)
Owns.clearAssoc(jack)
Page 35
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Computation
• Indexing (from 1 , not 0)
• Increment/Decrement
• Arithmetic/Logic
• Comparison
• Conditional
• Isolation
order.lineItems[i] order.lineItems->at(i)
index++ ++count
total + value address & mask
total > threshold index <= count
count != 0 && total/count > limit
count < min || count > max
$this.sensor.getReading().value
Page 36
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
C. Structure
• Structural and Behavioral Models
• Classes
• Associations
Page 37
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Structural and Behavioral Models
• A structural model (e.g., a class model) specifies the relevant
(types of) instances in a domain that may exist at any one point
in time.
– Structural semantics define how a structural model constrains
allowable instances.
• A behavioral model (e.g., an activity model) specifies behavior
over time
– Behavioral semantics define how a behavioral model changes the
state of instances over time.
Page 38
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Classes
• Attributes
• Data Types
• Primitive Types
• Operations and Methods
• Structural Semantics
• Behavioral Semantics
A class is a classifier of objects that persist in the extent of
the class, with an identity that is independent of the value of
their attributes at any one time.
A class is a classifier of objects that persist in the extent of
the class, with an identity that is independent of the value of
their attributes at any one time.
Page 39
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Classes and Attributes
A class may have
attributes whose types
are primitive, data
types or other classes.
A class may have
attributes whose types
are primitive, data
types or other classes.
A referential attribute,
whose type is a class, is
conventionally notated as
an association with a class-
owned association end.
A referential attribute,
whose type is a class, is
conventionally notated as
an association with a class-
owned association end.
A bidirectional association
results in corresponding
referential attributes on
both associated classes.
A bidirectional association
results in corresponding
referential attributes on
both associated classes.
Page 40
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Data Types
A data type is a classifier of transient data
values whose identity is based on the values
of their attributes.
A data type is a classifier of transient data
values whose identity is based on the values
of their attributes.
Data types may
have attributes, but
not operations.
Data types may
have attributes, but
not operations.
Page 41
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Primitive Types
• From UML 2.4.1 PrimitiveTypes Package
– Boolean
– Integer
– Real
– UnlimitedNatural
– String
Used since fUML
1.1
Used since fUML
1.1
Page 42
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Classes: Operations and Methods
An operation specifies a
behavior that may be
synchronously invoked
on an instance of a class.
An operation specifies a
behavior that may be
synchronously invoked
on an instance of a class.
A method defines
the actual behavior
that is invoked.
A method defines
the actual behavior
that is invoked.
Page 43
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Classes: Structural Semantics
Structural semantics specify how
a structural model constrains
allowable instances.
Structural semantics specify how
a structural model constrains
allowable instances.
Objects are instances
of classes with values
for each attribute.
Objects are instances
of classes with values
for each attribute.
Class-owned association
ends are structural features
with values, like attributes.
Class-owned association
ends are structural features
with values, like attributes.
fUML does not actually give
semantics to an association
with class-owned ends, only to
the ends as structural features.
fUML does not actually give
semantics to an association
with class-owned ends, only to
the ends as structural features.
Note: fUML does provide
“reified” semantics for
associations that own their own
ends, as will be discussed later.
Note: fUML does provide
“reified” semantics for
associations that own their own
ends, as will be discussed later.
Page 44
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Classes: Behavioral Semantics
• Creating an Order
• Adding a Line Item
• Canceling an Order
Behavioral semantics specify how a behavioral model
changes the state of instances over time.
Behavioral semantics specify how a behavioral model
changes the state of instances over time.
Page 45
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Creating an Order
order = new Order (customer, today)
Before After
@Create
public Order (in customer: Customer, in datePlaced: Date) {
this.datePlaced = datePlaced;
this.totalAmount = new Money(dollars=>0, cents=>0);
this.customer = customer;
this.customer.orders->add(this);
}
@Create
public Order (in customer: Customer, in datePlaced: Date) {
this.datePlaced = datePlaced;
this.totalAmount = new Money(dollars=>0, cents=>0);
this.customer = customer;
this.customer.orders->add(this);
}
A new object is created
and the constructor
operation is invoked.
A new object is created
and the constructor
operation is invoked.
The constructor initializes
the new order’s attribute
values…
The constructor initializes
the new order’s attribute
values…
…and adds the order
to the customer’s list.
…and adds the order
to the customer’s list.
Page 46
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Adding a Line Item
Before After
order.addProduct (product, 2)
public addProduct
(in product: Product, in quantity: Integer) {
lineItem = new LineItem(product, quantity);
this.lineItems->add(lineItem);
this.totalAmount = MoneyFunctions::Add
(this.totalAmount, lineItem.amount);
}
public addProduct
(in product: Product, in quantity: Integer) {
lineItem = new LineItem(product, quantity);
this.lineItems->add(lineItem);
this.totalAmount = MoneyFunctions::Add
(this.totalAmount, lineItem.amount);
}
The method for the
operation creates a
new line item object…
The method for the
operation creates a
new line item object…
The addProduct
operation is invoked
on an existing Order
object.
The addProduct
operation is invoked
on an existing Order
object.
…adds the new object
to the list of line items
for the order…
…adds the new object
to the list of line items
for the order…
…and updates
the total order
amount.
…and updates
the total order
amount.
Page 47
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Canceling an Order
Before After
order.cancel()
@Destroy
public cancel() {
this.customer.orders->remove(this);
}
@Destroy
public cancel() {
this.customer.orders->remove(this);
}
A destructor operation is
invoked, after which the
order object is destroyed.
A destructor operation is
invoked, after which the
order object is destroyed.
Because line items
are aggregated by
composition, they
are destroyed, too.
Because line items
are aggregated by
composition, they
are destroyed, too.
References to the
destroyed object must
be explicitly removed.
References to the
destroyed object must
be explicitly removed.
Page 48
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Associations
• Classes and Associations
• Structural Semantics
• Behavioral Semantics
An association is a classifier whose instances are links that
relate other instances.
An association is a classifier whose instances are links that
relate other instances.
Page 49
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Classes and Associations
An association (that owns its
ends) is a classifier of
persistent links between the
associated classes, which exist
in the extent of the association.
An association (that owns its
ends) is a classifier of
persistent links between the
associated classes, which exist
in the extent of the association.
Page 50
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Associations: Structural Semantics
Links are now semantic
instances of the indicated
associations.
Links are now semantic
instances of the indicated
associations.
Structural semantics specify how
a structural model constrains
allowable instance models.
Structural semantics specify how
a structural model constrains
allowable instance models.
Page 51
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Associations: Behavioral Semantics
• Creating an Order (revised)
• Canceling an Order (revised)
Behavioral semantics specify how a behavioral model
changes the state of instances over time.
Behavioral semantics specify how a behavioral model
changes the state of instances over time.
Page 52
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Creating an Order (revised)
order = new Order (customer, today)
Before After
@Create
public Order (in customer: Customer, in datePlaced: Date) {
this.datePlaced = datePlaced;
this.totalAmount = new Money(dollars=>0, cents=>0);
Customer_Order.addLink(customer, this);
}
@Create
public Order (in customer: Customer, in datePlaced: Date) {
this.datePlaced = datePlaced;
this.totalAmount = new Money(dollars=>0, cents=>0);
Customer_Order.addLink(customer, this);
}
A single action creates
a bidirectional link.
A single action creates
a bidirectional link.
Page 53
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Canceling an Order (revised)
Before After
order.cancel()
@Destroy
public cancel() { }
@Destroy
public cancel() { }
A destructor operation is
invoked, after which the
order object is destroyed.
A destructor operation is
invoked, after which the
order object is destroyed.
Links in which the
destroyed object
participates are now also
automatically destroyed.
Links in which the
destroyed object
participates are now also
automatically destroyed.
Page 54
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
D. Asynchronous Communication
• Signals and Receptions
• Classifier Behaviors
• Asynchronous Behavior
Page 55
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Signals and Receptions
A signal is a classifier
whose instances may
be communicated
asynchronously.
A signal is a classifier
whose instances may
be communicated
asynchronously.
A reception is a
declaration of the ability
to receive a signal.
A reception is a
declaration of the ability
to receive a signal.
A signal may have
attributes that represent
transmittable data.
A signal may have
attributes that represent
transmittable data.
More than one
class can receive
the same signal.
More than one
class can receive
the same signal.
Page 56
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Classifier Behaviors
An active class is one that
has a classifier behavior.
Only active class may
receive signals.
An active class is one that
has a classifier behavior.
Only active class may
receive signals.
A classifier behavior is an
autonomous behavior
started when an active
class is instantiated.
A classifier behavior is an
autonomous behavior
started when an active
class is instantiated.
Page 57
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Asynchronous Behavior
accept (submission: SubmitCharge);
card = submission.card;
do {
new CreditCardCharge(card, this);
accept (response: ChargeApproved) {
this.customer.ChargeApproved(response.charge);
break;
} or accept (response: ChargeDeclined) {
this.customer.ChargeDeclined(response.charge);
}
while (true);
accept (submission: SubmitCharge);
card = submission.card;
do {
new CreditCardCharge(card, this);
accept (response: ChargeApproved) {
this.customer.ChargeApproved(response.charge);
break;
} or accept (response: ChargeDeclined) {
this.customer.ChargeDeclined(response.charge);
}
while (true);
The order object
accepts a signal to
submit a charge.
The order object
accepts a signal to
submit a charge.
The order object creates
a new credit card charge
object, which begins its
asynchronous behavior.
The order object creates
a new credit card charge
object, which begins its
asynchronous behavior.
Note: UML semantics require a separate action
to start the behavior of a new object. However,
Alf notation for creating an active class maps to
both create and start object behavior actions.
Note: UML semantics require a separate action
to start the behavior of a new object. However,
Alf notation for creating an active class maps to
both create and start object behavior actions.
The order object
accepts a signal from
the charge object that
the charge is approved.
The order object
accepts a signal from
the charge object that
the charge is approved.The order object
sends a signal to the
customer that the
charge is approved.
The order object
sends a signal to the
customer that the
charge is approved.
Page 58
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
III. Standard Model Library
• Primitive Behaviors
• Collection Functions
• Collection Classes
• Basic Input/Output
Page 59
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Primitive Behaviors
• Integer Functions – Arithmetic, Comparison, Conversion
• Unlimited Natural Functions – Comparison, Conversion
• Boolean Functions – Logical Operations, Conversion
• Bit String Functions – Bit-wise operations, Conversion
• String Functions – Concatenation, Size, Substring
• RealFunctions – Arithmetic, Comparison, Conversion
Added in fUML 1.1Added in fUML 1.1
Page 60
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Collection Functions
Collection functions operate on sequences of values of any type.
• Testing and accessing functions
– Examples: seq->isEmpty(), seq1->equals(seq2), seq->at(n)
• Non-mutating funtions
– Examples: seq2 = seq->including(x), seq3 = seq1->union(seq2)
• Mutating “in place” functions
– Examples: seq->add(x), seq1->addAll(seq2), seq2->remove(x)
Page 61
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Collection Classes
Collection classes define objects that represent collections of
values of a given type.
Page 62
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Basic Input Output: Channels
Page 63
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Basic Input Output: Reading and Writing Lines
activity ReadLine
(out errorStatus: Status[0..1]): String {
return StandardIntputChannel.allInstances().readLine(status);
}
activity ReadLine
(out errorStatus: Status[0..1]): String {
return StandardIntputChannel.allInstances().readLine(status);
}
activity WriteLine
(in value: String, out errorStatus: Status[0..1]) {
StandardOutputChannel.allInstances().writeLine(result, status);
}
activity WriteLine
(in value: String, out errorStatus: Status[0..1]) {
StandardOutputChannel.allInstances().writeLine(result, status);
}
Page 64
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
Hello World
activity Hello() {
WriteLine("Hello World!");
}
activity Hello() {
WriteLine("Hello World!");
}
Page 65
Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
References
• Foundational UML (fUML)
– Semantics of a Foundational Subset for Executable UML Models
standard, http://www.omg.org/spec/FUML
– fUML Open Source (Reference) Implementation Project,
http://fuml.modeldriven.org/
• Action Language for fUML (Alf)
– Action Language for Foundational UML (Alf) standard,
http://www.omg.org/spec/ALF
– Alf Open Source (Reference) Implementation Repository,
http://alf.modeldriven.org/
• Contact
– Email: ed-s@modeldriven.com
– Twitter: @seidewitz or http://twitter.com/seidewitz

Mais conteúdo relacionado

Mais procurados

SysML v2 and MBSE: The next ten years
SysML v2 and MBSE: The next ten yearsSysML v2 and MBSE: The next ten years
SysML v2 and MBSE: The next ten yearsEd Seidewitz
 
Introduction to the OMG Systems Modeling Language (SysML), Version 2
Introduction to the OMG Systems Modeling Language (SysML), Version 2Introduction to the OMG Systems Modeling Language (SysML), Version 2
Introduction to the OMG Systems Modeling Language (SysML), Version 2Ed Seidewitz
 
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...Obeo
 
CapellaDays2022 | ThermoFisher - ESI TNO | A method for quantitative evaluati...
CapellaDays2022 | ThermoFisher - ESI TNO | A method for quantitative evaluati...CapellaDays2022 | ThermoFisher - ESI TNO | A method for quantitative evaluati...
CapellaDays2022 | ThermoFisher - ESI TNO | A method for quantitative evaluati...Obeo
 
Scripting with Python to interact with Capella model
Scripting with Python to interact with Capella modelScripting with Python to interact with Capella model
Scripting with Python to interact with Capella modelObeo
 
MBSE with Arcadia method step-by-step System Analysis.pdf
MBSE with Arcadia method step-by-step System Analysis.pdfMBSE with Arcadia method step-by-step System Analysis.pdf
MBSE with Arcadia method step-by-step System Analysis.pdfHelder Castro
 
MBSE with Arcadia method.pdf
MBSE with Arcadia method.pdfMBSE with Arcadia method.pdf
MBSE with Arcadia method.pdfHelder Castro
 
Improving MBSE maturity with open-source tool Capella
Improving MBSE maturity with open-source tool Capella Improving MBSE maturity with open-source tool Capella
Improving MBSE maturity with open-source tool Capella Obeo
 
System of systems modeling with Capella
System of systems modeling with CapellaSystem of systems modeling with Capella
System of systems modeling with CapellaObeo
 
Mule with workday connectors
Mule with workday connectorsMule with workday connectors
Mule with workday connectorsSon Nguyen
 
Equivalences and diffrences between SysML and Arcadia / Capella
Equivalences and diffrences between SysML and Arcadia / CapellaEquivalences and diffrences between SysML and Arcadia / Capella
Equivalences and diffrences between SysML and Arcadia / CapellaObeo
 
MBSE with Arcadia method step-by-step Physical Architecture.pdf
MBSE with Arcadia method step-by-step Physical Architecture.pdfMBSE with Arcadia method step-by-step Physical Architecture.pdf
MBSE with Arcadia method step-by-step Physical Architecture.pdfHelder Castro
 
Introduction to Capella and Arcadia with a Simple System
Introduction to Capella and Arcadia with a Simple SystemIntroduction to Capella and Arcadia with a Simple System
Introduction to Capella and Arcadia with a Simple SystemObeo
 
Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...
Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...
Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...Obeo
 
SysML v2 - What's the big deal, anyway?
SysML v2 - What's the big deal, anyway?SysML v2 - What's the big deal, anyway?
SysML v2 - What's the big deal, anyway?Ed Seidewitz
 
Capella Days 2021 | An example of model-centric engineering environment with ...
Capella Days 2021 | An example of model-centric engineering environment with ...Capella Days 2021 | An example of model-centric engineering environment with ...
Capella Days 2021 | An example of model-centric engineering environment with ...Obeo
 
[Capella Day 2019] Model execution and system simulation in Capella
[Capella Day 2019] Model execution and system simulation in Capella[Capella Day 2019] Model execution and system simulation in Capella
[Capella Day 2019] Model execution and system simulation in CapellaObeo
 
Capella Days 2021 | Introduction to CAPELLA/ARCADIA and NASA Systems Engineer...
Capella Days 2021 | Introduction to CAPELLA/ARCADIA and NASA Systems Engineer...Capella Days 2021 | Introduction to CAPELLA/ARCADIA and NASA Systems Engineer...
Capella Days 2021 | Introduction to CAPELLA/ARCADIA and NASA Systems Engineer...Obeo
 
Object Process Methodology
Object Process MethodologyObject Process Methodology
Object Process Methodologyguest77b0cd12
 

Mais procurados (20)

SysML v2 and MBSE: The next ten years
SysML v2 and MBSE: The next ten yearsSysML v2 and MBSE: The next ten years
SysML v2 and MBSE: The next ten years
 
Introduction to the OMG Systems Modeling Language (SysML), Version 2
Introduction to the OMG Systems Modeling Language (SysML), Version 2Introduction to the OMG Systems Modeling Language (SysML), Version 2
Introduction to the OMG Systems Modeling Language (SysML), Version 2
 
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
 
CapellaDays2022 | ThermoFisher - ESI TNO | A method for quantitative evaluati...
CapellaDays2022 | ThermoFisher - ESI TNO | A method for quantitative evaluati...CapellaDays2022 | ThermoFisher - ESI TNO | A method for quantitative evaluati...
CapellaDays2022 | ThermoFisher - ESI TNO | A method for quantitative evaluati...
 
Scripting with Python to interact with Capella model
Scripting with Python to interact with Capella modelScripting with Python to interact with Capella model
Scripting with Python to interact with Capella model
 
MBSE with Arcadia method step-by-step System Analysis.pdf
MBSE with Arcadia method step-by-step System Analysis.pdfMBSE with Arcadia method step-by-step System Analysis.pdf
MBSE with Arcadia method step-by-step System Analysis.pdf
 
MBSE with Arcadia method.pdf
MBSE with Arcadia method.pdfMBSE with Arcadia method.pdf
MBSE with Arcadia method.pdf
 
Improving MBSE maturity with open-source tool Capella
Improving MBSE maturity with open-source tool Capella Improving MBSE maturity with open-source tool Capella
Improving MBSE maturity with open-source tool Capella
 
System of systems modeling with Capella
System of systems modeling with CapellaSystem of systems modeling with Capella
System of systems modeling with Capella
 
Mule with workday connectors
Mule with workday connectorsMule with workday connectors
Mule with workday connectors
 
Equivalences and diffrences between SysML and Arcadia / Capella
Equivalences and diffrences between SysML and Arcadia / CapellaEquivalences and diffrences between SysML and Arcadia / Capella
Equivalences and diffrences between SysML and Arcadia / Capella
 
MBSE with Arcadia method step-by-step Physical Architecture.pdf
MBSE with Arcadia method step-by-step Physical Architecture.pdfMBSE with Arcadia method step-by-step Physical Architecture.pdf
MBSE with Arcadia method step-by-step Physical Architecture.pdf
 
Introduction to Capella and Arcadia with a Simple System
Introduction to Capella and Arcadia with a Simple SystemIntroduction to Capella and Arcadia with a Simple System
Introduction to Capella and Arcadia with a Simple System
 
Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...
Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...
Capella Days 2021 | Where to Start with MBSE when Thousands of System Require...
 
SysML v2 - What's the big deal, anyway?
SysML v2 - What's the big deal, anyway?SysML v2 - What's the big deal, anyway?
SysML v2 - What's the big deal, anyway?
 
Capella Days 2021 | An example of model-centric engineering environment with ...
Capella Days 2021 | An example of model-centric engineering environment with ...Capella Days 2021 | An example of model-centric engineering environment with ...
Capella Days 2021 | An example of model-centric engineering environment with ...
 
[Capella Day 2019] Model execution and system simulation in Capella
[Capella Day 2019] Model execution and system simulation in Capella[Capella Day 2019] Model execution and system simulation in Capella
[Capella Day 2019] Model execution and system simulation in Capella
 
Capella Days 2021 | Introduction to CAPELLA/ARCADIA and NASA Systems Engineer...
Capella Days 2021 | Introduction to CAPELLA/ARCADIA and NASA Systems Engineer...Capella Days 2021 | Introduction to CAPELLA/ARCADIA and NASA Systems Engineer...
Capella Days 2021 | Introduction to CAPELLA/ARCADIA and NASA Systems Engineer...
 
Dissecting SysML v2.pptx
Dissecting SysML v2.pptxDissecting SysML v2.pptx
Dissecting SysML v2.pptx
 
Object Process Methodology
Object Process MethodologyObject Process Methodology
Object Process Methodology
 

Semelhante a Programming in UML: An Introduction to fUML 1.3 and Alf 1.1

Executable UML and SysML Workshop
Executable UML and SysML WorkshopExecutable UML and SysML Workshop
Executable UML and SysML WorkshopEd Seidewitz
 
Precise Semantics Standards at OMG: Executing on the Vision
Precise Semantics Standards at OMG: Executing on the VisionPrecise Semantics Standards at OMG: Executing on the Vision
Precise Semantics Standards at OMG: Executing on the VisionEd Seidewitz
 
UML: Once More with Meaning
UML: Once More with MeaningUML: Once More with Meaning
UML: Once More with MeaningEd Seidewitz
 
UML: This Time We Mean It!
UML: This Time We Mean It!UML: This Time We Mean It!
UML: This Time We Mean It!Ed Seidewitz
 
Introduction to Business Modeling
Introduction to Business ModelingIntroduction to Business Modeling
Introduction to Business ModelingLaurence White
 
L06_IntroductionToUML.ppsx
L06_IntroductionToUML.ppsxL06_IntroductionToUML.ppsx
L06_IntroductionToUML.ppsxVijayAgrahari3
 
Standards-Based Executable UML: Today's Reality and Tomorrow's Promise
Standards-Based Executable UML: Today's Reality and Tomorrow's PromiseStandards-Based Executable UML: Today's Reality and Tomorrow's Promise
Standards-Based Executable UML: Today's Reality and Tomorrow's PromiseEd Seidewitz
 
Unified Modeling Language (UML)
Unified Modeling Language (UML)Unified Modeling Language (UML)
Unified Modeling Language (UML)Ajeng Savitri
 
Interaction Flow Modeling Language (IFML) First Submission at OMG
Interaction Flow Modeling Language (IFML)  First Submission at OMG Interaction Flow Modeling Language (IFML)  First Submission at OMG
Interaction Flow Modeling Language (IFML) First Submission at OMG Marco Brambilla
 
UML Diagrams- Unified Modeling Language Introduction
UML Diagrams- Unified Modeling Language IntroductionUML Diagrams- Unified Modeling Language Introduction
UML Diagrams- Unified Modeling Language IntroductionRamakant Soni
 
Practical Experiences Migrating Unified Modeling Language Models to IBM® Rati...
PracticalExperiences Migrating Unified Modeling Language Models to IBM® Rati...PracticalExperiences Migrating Unified Modeling Language Models to IBM® Rati...
Practical Experiences Migrating Unified Modeling Language Models to IBM® Rati...Einar Karlsen
 
AIXM, WXXM, FIXM a unified approach to Modelling
AIXM, WXXM, FIXM a unified approach to ModellingAIXM, WXXM, FIXM a unified approach to Modelling
AIXM, WXXM, FIXM a unified approach to ModellingSnowflake Software
 
PhD Core Paper Unit 5 _Part 1 Software Design and UML Use Case Modeling.pdf
PhD Core Paper Unit 5 _Part 1 Software Design and UML Use Case Modeling.pdfPhD Core Paper Unit 5 _Part 1 Software Design and UML Use Case Modeling.pdf
PhD Core Paper Unit 5 _Part 1 Software Design and UML Use Case Modeling.pdfJAYANTHIKANNAN8
 
IFML - Interaction Flow Modeling Language - tutorial on UI and UX modeling &...
IFML -  Interaction Flow Modeling Language - tutorial on UI and UX modeling &...IFML -  Interaction Flow Modeling Language - tutorial on UI and UX modeling &...
IFML - Interaction Flow Modeling Language - tutorial on UI and UX modeling &...Marco Brambilla
 
Unit-II(STATIC UML DIAGRAMS).ppt
Unit-II(STATIC UML DIAGRAMS).pptUnit-II(STATIC UML DIAGRAMS).ppt
Unit-II(STATIC UML DIAGRAMS).pptganeshkarthy
 

Semelhante a Programming in UML: An Introduction to fUML 1.3 and Alf 1.1 (20)

Executable UML and SysML Workshop
Executable UML and SysML WorkshopExecutable UML and SysML Workshop
Executable UML and SysML Workshop
 
Precise Semantics Standards at OMG: Executing on the Vision
Precise Semantics Standards at OMG: Executing on the VisionPrecise Semantics Standards at OMG: Executing on the Vision
Precise Semantics Standards at OMG: Executing on the Vision
 
UML: Once More with Meaning
UML: Once More with MeaningUML: Once More with Meaning
UML: Once More with Meaning
 
UML: This Time We Mean It!
UML: This Time We Mean It!UML: This Time We Mean It!
UML: This Time We Mean It!
 
Introduction to Business Modeling
Introduction to Business ModelingIntroduction to Business Modeling
Introduction to Business Modeling
 
L06_IntroductionToUML.ppsx
L06_IntroductionToUML.ppsxL06_IntroductionToUML.ppsx
L06_IntroductionToUML.ppsx
 
Standards-Based Executable UML: Today's Reality and Tomorrow's Promise
Standards-Based Executable UML: Today's Reality and Tomorrow's PromiseStandards-Based Executable UML: Today's Reality and Tomorrow's Promise
Standards-Based Executable UML: Today's Reality and Tomorrow's Promise
 
Unified Modeling Language (UML)
Unified Modeling Language (UML)Unified Modeling Language (UML)
Unified Modeling Language (UML)
 
3.UML Diagrams.pptx
3.UML Diagrams.pptx3.UML Diagrams.pptx
3.UML Diagrams.pptx
 
UML
UMLUML
UML
 
Interaction Flow Modeling Language (IFML) First Submission at OMG
Interaction Flow Modeling Language (IFML)  First Submission at OMG Interaction Flow Modeling Language (IFML)  First Submission at OMG
Interaction Flow Modeling Language (IFML) First Submission at OMG
 
Unified Modeling Language
Unified Modeling LanguageUnified Modeling Language
Unified Modeling Language
 
4 (uml basic)
4 (uml basic)4 (uml basic)
4 (uml basic)
 
UML Diagrams- Unified Modeling Language Introduction
UML Diagrams- Unified Modeling Language IntroductionUML Diagrams- Unified Modeling Language Introduction
UML Diagrams- Unified Modeling Language Introduction
 
Practical Experiences Migrating Unified Modeling Language Models to IBM® Rati...
PracticalExperiences Migrating Unified Modeling Language Models to IBM® Rati...PracticalExperiences Migrating Unified Modeling Language Models to IBM® Rati...
Practical Experiences Migrating Unified Modeling Language Models to IBM® Rati...
 
AIXM, WXXM, FIXM a unified approach to Modelling
AIXM, WXXM, FIXM a unified approach to ModellingAIXM, WXXM, FIXM a unified approach to Modelling
AIXM, WXXM, FIXM a unified approach to Modelling
 
PhD Core Paper Unit 5 _Part 1 Software Design and UML Use Case Modeling.pdf
PhD Core Paper Unit 5 _Part 1 Software Design and UML Use Case Modeling.pdfPhD Core Paper Unit 5 _Part 1 Software Design and UML Use Case Modeling.pdf
PhD Core Paper Unit 5 _Part 1 Software Design and UML Use Case Modeling.pdf
 
IFML - Interaction Flow Modeling Language - tutorial on UI and UX modeling &...
IFML -  Interaction Flow Modeling Language - tutorial on UI and UX modeling &...IFML -  Interaction Flow Modeling Language - tutorial on UI and UX modeling &...
IFML - Interaction Flow Modeling Language - tutorial on UI and UX modeling &...
 
Uml2 David Kemp 20060716
Uml2 David Kemp 20060716Uml2 David Kemp 20060716
Uml2 David Kemp 20060716
 
Unit-II(STATIC UML DIAGRAMS).ppt
Unit-II(STATIC UML DIAGRAMS).pptUnit-II(STATIC UML DIAGRAMS).ppt
Unit-II(STATIC UML DIAGRAMS).ppt
 

Mais de Ed Seidewitz

Leveraging Alf for SysML, Part 2: More Effective Trade Study Modeling
Leveraging Alf for SysML, Part 2: More Effective Trade Study ModelingLeveraging Alf for SysML, Part 2: More Effective Trade Study Modeling
Leveraging Alf for SysML, Part 2: More Effective Trade Study ModelingEd Seidewitz
 
The Very Model of a Modern Metamodeler
The Very Model of a Modern MetamodelerThe Very Model of a Modern Metamodeler
The Very Model of a Modern MetamodelerEd Seidewitz
 
SysML v2 and the Next Generation of Modeling Languages
SysML v2 and the Next Generation of Modeling LanguagesSysML v2 and the Next Generation of Modeling Languages
SysML v2 and the Next Generation of Modeling LanguagesEd Seidewitz
 
Model Driven Architecture without Automation
Model Driven Architecture without AutomationModel Driven Architecture without Automation
Model Driven Architecture without AutomationEd Seidewitz
 
Using Alf with Cameo Simulation Toolkit - Part 1: Basics
Using Alf with Cameo Simulation Toolkit - Part 1: BasicsUsing Alf with Cameo Simulation Toolkit - Part 1: Basics
Using Alf with Cameo Simulation Toolkit - Part 1: BasicsEd Seidewitz
 
Hands On With the Alf Action Language: Making Executable Modeling Even Easier
Hands On With the Alf Action Language: Making Executable Modeling Even EasierHands On With the Alf Action Language: Making Executable Modeling Even Easier
Hands On With the Alf Action Language: Making Executable Modeling Even EasierEd Seidewitz
 
A Unified View of Modeling and Programming
A Unified View of Modeling and ProgrammingA Unified View of Modeling and Programming
A Unified View of Modeling and ProgrammingEd Seidewitz
 
UML as a Programming Language
UML as a Programming LanguageUML as a Programming Language
UML as a Programming LanguageEd Seidewitz
 
Executable UML Roadmap (as of September 2014)
Executable UML Roadmap (as of September 2014)Executable UML Roadmap (as of September 2014)
Executable UML Roadmap (as of September 2014)Ed Seidewitz
 
Essence: A Common Ground for Flexible Methods
Essence: A Common Ground for Flexible MethodsEssence: A Common Ground for Flexible Methods
Essence: A Common Ground for Flexible MethodsEd Seidewitz
 
Succeeding with Agile in the Federal Government: A Coach's Perspective
Succeeding with Agile in the Federal Government: A Coach's PerspectiveSucceeding with Agile in the Federal Government: A Coach's Perspective
Succeeding with Agile in the Federal Government: A Coach's PerspectiveEd Seidewitz
 
UML 2.5: Specification Simplification
UML 2.5: Specification SimplificationUML 2.5: Specification Simplification
UML 2.5: Specification SimplificationEd Seidewitz
 
Models, Programs and Executable UML
Models, Programs and Executable UMLModels, Programs and Executable UML
Models, Programs and Executable UMLEd Seidewitz
 
Architecting Your Enterprise
Architecting Your EnterpriseArchitecting Your Enterprise
Architecting Your EnterpriseEd Seidewitz
 
Programming in UML: Why and How
Programming in UML: Why and HowProgramming in UML: Why and How
Programming in UML: Why and HowEd Seidewitz
 

Mais de Ed Seidewitz (15)

Leveraging Alf for SysML, Part 2: More Effective Trade Study Modeling
Leveraging Alf for SysML, Part 2: More Effective Trade Study ModelingLeveraging Alf for SysML, Part 2: More Effective Trade Study Modeling
Leveraging Alf for SysML, Part 2: More Effective Trade Study Modeling
 
The Very Model of a Modern Metamodeler
The Very Model of a Modern MetamodelerThe Very Model of a Modern Metamodeler
The Very Model of a Modern Metamodeler
 
SysML v2 and the Next Generation of Modeling Languages
SysML v2 and the Next Generation of Modeling LanguagesSysML v2 and the Next Generation of Modeling Languages
SysML v2 and the Next Generation of Modeling Languages
 
Model Driven Architecture without Automation
Model Driven Architecture without AutomationModel Driven Architecture without Automation
Model Driven Architecture without Automation
 
Using Alf with Cameo Simulation Toolkit - Part 1: Basics
Using Alf with Cameo Simulation Toolkit - Part 1: BasicsUsing Alf with Cameo Simulation Toolkit - Part 1: Basics
Using Alf with Cameo Simulation Toolkit - Part 1: Basics
 
Hands On With the Alf Action Language: Making Executable Modeling Even Easier
Hands On With the Alf Action Language: Making Executable Modeling Even EasierHands On With the Alf Action Language: Making Executable Modeling Even Easier
Hands On With the Alf Action Language: Making Executable Modeling Even Easier
 
A Unified View of Modeling and Programming
A Unified View of Modeling and ProgrammingA Unified View of Modeling and Programming
A Unified View of Modeling and Programming
 
UML as a Programming Language
UML as a Programming LanguageUML as a Programming Language
UML as a Programming Language
 
Executable UML Roadmap (as of September 2014)
Executable UML Roadmap (as of September 2014)Executable UML Roadmap (as of September 2014)
Executable UML Roadmap (as of September 2014)
 
Essence: A Common Ground for Flexible Methods
Essence: A Common Ground for Flexible MethodsEssence: A Common Ground for Flexible Methods
Essence: A Common Ground for Flexible Methods
 
Succeeding with Agile in the Federal Government: A Coach's Perspective
Succeeding with Agile in the Federal Government: A Coach's PerspectiveSucceeding with Agile in the Federal Government: A Coach's Perspective
Succeeding with Agile in the Federal Government: A Coach's Perspective
 
UML 2.5: Specification Simplification
UML 2.5: Specification SimplificationUML 2.5: Specification Simplification
UML 2.5: Specification Simplification
 
Models, Programs and Executable UML
Models, Programs and Executable UMLModels, Programs and Executable UML
Models, Programs and Executable UML
 
Architecting Your Enterprise
Architecting Your EnterpriseArchitecting Your Enterprise
Architecting Your Enterprise
 
Programming in UML: Why and How
Programming in UML: Why and HowProgramming in UML: Why and How
Programming in UML: Why and How
 

Último

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Último (20)

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

Programming in UML: An Introduction to fUML 1.3 and Alf 1.1

  • 1. 19 March 2018 Copyright © 2018 Model Driven Solutions, Inc. Programming in UML: An Introduction to fUML and Alf Updated for fUML 1.3 and Alf 1.1
  • 2. Page 2 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Agenda I. Introduction II. Elements of Executable UML III. Standard Model Library
  • 3. Page 3 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 I. Introduction A. A Motivating Example B. Executable UML C. The Standards
  • 4. Page 4 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 A. A Motivating Example • E-Commerce Ordering System – Loosely based on the Online Bookstore Domain Case Study given in Appendix B of the book Executable UML: A Foundation for Model Driven Architecture by Stephen J. Mellor and Marc J. Balcer (Addison-Wesley, 2002) • To be designed in UML – Class models for structure – State machine models for behavior • To be implemented on the Web – Using Java/JEE – …or maybe C#/.Net – …or maybe LAMP – …or whatever…
  • 5. Page 5 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Ordering: Class Model Order is an active class whose classifier behavior is responsible for handling ordering functionality. Order is an active class whose classifier behavior is responsible for handling ordering functionality.
  • 6. Page 6 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Order: Classifier Behavior A state machine abstracts system behavior into a finite number of states. A state machine abstracts system behavior into a finite number of states. The system is modeled as having discrete transitions between the states. The system is modeled as having discrete transitions between the states. A transition may trigger further system behavior or system behavior may be dependent on the current state. A transition may trigger further system behavior or system behavior may be dependent on the current state.
  • 7. Page 7 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Order Behavior: EstablishCustomer Activity An activity specifies behavior as the coordinated execution of a set of subordinate actions. An activity specifies behavior as the coordinated execution of a set of subordinate actions. An action in one activity may call another activity. An action in one activity may call another activity. Data and control flow between the various actions. Data and control flow between the various actions. Other actions provide various data and computational functions. Other actions provide various data and computational functions. Full executability requires complete specification of behavior and computation. This is often much more easy to specify using a textual notation. Full executability requires complete specification of behavior and computation. This is often much more easy to specify using a textual notation.
  • 8. Page 8 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 The Question Is… • If we are going to take the time to carefully design our system using UML, e.g., – Structural models of classes and associations – Behavioral models using state machines or operations and messages • Then why can’t we use these directly to execute our system? The answer is: We can! • Just add detailed behavior… – …which is best done using a textual action language… – …which should be at the same semantic level as the rest of the model.
  • 9. Page 9 B. Executable UML: Perceived Issues • Making models detailed enough for machine execution defeats the purpose of models for human communication. • UML is not specified precisely enough to be executed (at least not in a standard way). • Graphical modeling notations are not good for detailed programming. Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
  • 10. Page 10 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Executable UML: Issue Resolutions • Making models detailed enough for machine execution defeats the purpose of models for human communication. – Executable models can still be more understandable than executable code. – Non-executable models are still useful, too. • UML is not specified precisely enough to be executed (at least not in a standard way). – The Foundational UML (fUML) standard specifies precise semantics for an executable subset of UML. – fUML Version 1.0 formal specification now available. • Graphical modeling notations are not good for detailed programming. – The Action Language for fUML (Alf) standard specifies a textual action language with fUML semantics. – Alf Version 1.0 finalization in progress.
  • 11. Page 11 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 C. The Standards • Unified Modeling Language (UML) • Executable UML Foundation (fUML) • UML Action Language (Alf)
  • 12. Page 12 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Unified Modeling Language (UML) The Unified Modeling Language (UML) is a graphical language for modeling the structure, behavior and interactions of software, hardware and business systems, standardized by the Object Management Group (OMG). • UML Version 1.1 (first standard) – December 1997 • UML Version 1.5 (with action semantics) – March 2003 • UML Version 2.0 (new version) – July 2005 • UML Version 2.4.1 – July 2011 • UML Version 2.5 (spec simplification) – May 2015 • UML Version 2.5.1 (current standard) – December 2017
  • 13. Page 13 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Executable UML Foundation (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. • fUML Version 1.0 – January 2011 • fUML Version 1.1 – July 2013 • fUML Version 1.2.1 – December 2016 • fUML Version 1.3 (current standard) – October 2017 • fUML Version 1.4 (migration to UML 2.5.1) – 2018 (planned)
  • 14. Page 14 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Key Components • Foundational UML Subset (fUML) – A computationally complete subset of the abstract syntax of UML (Version 2.4.1) – Kernel – Basic object-oriented capabilities – Common Behavior – General behavior and asynchronous communication – Activities – Activity modeling, including structured activities (but not including variables, exceptions, swimlanes, streaming or other “higher level” activity modeling) • Execution Model – A model of the execution semantics of user models within the fUML subset • Foundational Model Library – Primitive Types – Boolean, String, Integer, Real, Unlimited Natural – Primitive Behaviors – Boolean, String and Arithmetic Functions – Basic Input/Output – Based on the concept of “Channels” Added in fUML 1.1 Added in fUML 1.1
  • 15. Page 15 Other Precise Semantics Specifications The following specifications build on the foundation of fUML: •Precise Semantics of UML Composite Structure (PSCS) – Version 1.1 (beta) – June 2017 •Precise Semantics of UML State Machines (PSCS) – Version 1.0 (alpha) – December 2016 (in finalization) •Precise Semantics of Time for Foundational UML – RFP issued – December 2017 – Revised submissions due – August 2019 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018
  • 16. Page 16 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 UML Action Language (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 an extended notation for structural modeling within the fUML subset.) • Alf Version 1.0 (beta) – November 2012 • Alf Version 1.0.1 (migration to fUML 1.1) – September 2013 • Alf Version 1.1 (current standard) – June 2017 • Alf Version 1.2 (migration to fUML 1.4) – 2018/2019 (planned)
  • 17. Page 17 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Key Components • Concrete Syntax – A BNF specification of the legal textual syntax of the Alf language. • Abstract Syntax – A MOF metamodel of the abstract syntax tree that is synthesized during parsing of an Alf text, with additional derived attributes and constraints that specify the static semantic analysis of that text. • Semantics – The semantics of Alf are defined by mapping the Alf abstract syntax metamodel to the fUML abstract syntax metamodel. • Standard Model Library – From the fUML Foundational Model Library • Primitive Types (plus Natural and Bit String) • Primitive Behaviors (plus Bit String Functions and Sequence Functions) • Basic Input/Output – Collection Functions – Similar to OCL collection operations for sequences – Collection Classes – Set, Ordered Set, Bag, List, Queue, Deque, Map
  • 18. Page 18 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 II. Elements of Executable UML A. Activities B. Actions C. Structure D. Asynchronous Communication
  • 19. Page 19 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 A. Activities • Activities and Parameters • Actions and Flows • Textual Notation • Tokens • Offers • Control Nodes • Structured Nodes
  • 20. Page 20 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Activities and Parameters An activity is a specification of behavior as the coordinated execution of subordinate actions, using a control and data flow model. An activity is a specification of behavior as the coordinated execution of subordinate actions, using a control and data flow model. An activity may have input, output and return parameters. An activity may have input, output and return parameters. The parameters have corresponding activity parameter node on the boundary of the diagrammatic representation of an activity. The parameters have corresponding activity parameter node on the boundary of the diagrammatic representation of an activity.
  • 21. Page 21 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Actions and Flows An action is a fundamental unit of executable behavior within an activity. An action is a fundamental unit of executable behavior within an activity. A pin is an activity node that either accepts input to or provides output from an action. A pin is an activity node that either accepts input to or provides output from an action. An object flow provides a path for passing objects or data. An object flow provides a path for passing objects or data. A control flow specifies the sequencing of actions. A control flow specifies the sequencing of actions. An activity diagram is a graph structure consisting of activity nodes connected by activity edges. An activity diagram is a graph structure consisting of activity nodes connected by activity edges.
  • 22. Page 22 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Textual Notation activity DoSomething(in input: Integer, out output Integer): Integer { output = A(input); return B(); } activity DoSomething(in input: Integer, out output Integer): Integer { output = A(input); return B(); } Alf behavioral notation maps to fUML activity models. Alf behavioral notation maps to fUML activity models. The semantics of the Alf notation is defined by its mapping to fUML The semantics of the Alf notation is defined by its mapping to fUML
  • 23. Page 23 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Tokens a = DoSomething(1, b);a = DoSomething(1, b); A token is a container for an object, datum or locus of control that may be present at an activity node. A token is a container for an object, datum or locus of control that may be present at an activity node. The activity is invoked with an argument of 1 for its input parameter. The activity is invoked with an argument of 1 for its input parameter. An object token with a value of 1 is placed on the input activity parameter node. An object token with a value of 1 is placed on the input activity parameter node. The object token flows to the input pin of action A along the object flow. The object token flows to the input pin of action A along the object flow. Action A fires and produces an object token on its output pin. Action A fires and produces an object token on its output pin. The object token flows to the output activity parameter node along the object flow. The object token flows to the output activity parameter node along the object flow. When it is done, action A produces a control token, which flows to action B along the control flow. When it is done, action A produces a control token, which flows to action B along the control flow. Action B accepts the control token and fires, producing an object token on its output pin. Action B accepts the control token and fires, producing an object token on its output pin. The object token flows to the output activity parameter node along the object flow. The object token flows to the output activity parameter node along the object flow. Values on the output activity parameter nodes are copied to the output arguments. Values on the output activity parameter nodes are copied to the output arguments.
  • 24. Page 24 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Offers An output pin offers its tokens to the targets of all outgoing object flows. An output pin offers its tokens to the targets of all outgoing object flows. A single token can only flow to one target. If two competing targets are both ready to accept an offer for the same token, it is indeterminate which will get the token. A single token can only flow to one target. If two competing targets are both ready to accept an offer for the same token, it is indeterminate which will get the token. Note: fUML semantics do not guarantee “liveliness” or “fairness” in the execution of actions competing for tokens. Note: fUML semantics do not guarantee “liveliness” or “fairness” in the execution of actions competing for tokens. Actions with no control constraints execute concurrently. This means that they may execute in parallel – or they may execute sequentially in any order. Actions with no control constraints execute concurrently. This means that they may execute in parallel – or they may execute sequentially in any order.
  • 25. Page 25 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Fork and Join Nodes order = 'Create Order'(); //@parallel { 'Fulfill Order'(order); 'Invoice Order'(order); } 'Close Out Order'(order); order = 'Create Order'(); //@parallel { 'Fulfill Order'(order); 'Invoice Order'(order); } 'Close Out Order'(order); A fork node copies the tokens it is offered, and offers a copy on each outgoing flow. A fork node copies the tokens it is offered, and offers a copy on each outgoing flow. A join node waits for a token to be offered on all incoming flows and then offers tokens on its outgoing flow. A join node waits for a token to be offered on all incoming flows and then offers tokens on its outgoing flow. In the Alf textual notation, forks and joins are implicit in the parallel block notation. In the Alf textual notation, forks and joins are implicit in the parallel block notation. Note: Alf does not actually provide any notation for competition for tokens on output pins. A fork node is always inserted for multiple flows out of any output pin. Note: Alf does not actually provide any notation for competition for tokens on output pins. A fork node is always inserted for multiple flows out of any output pin.
  • 26. Page 26 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Control Nodes An initial node generates a single control token. An initial node generates a single control token.A merge node passes on any tokens it receives. A merge node passes on any tokens it receives. A decision node routes tokens based on a decision input value. A decision node routes tokens based on a decision input value. An activity final node terminates the activity when it receives a token. An activity final node terminates the activity when it receives a token. A control node is an activity node used to coordinate the flow of (the offers for) tokens between other nodes. A control node is an activity node used to coordinate the flow of (the offers for) tokens between other nodes. Note: A data store node is used so a “card” token is available for each iteration. Note: A data store node is used so a “card” token is available for each iteration. Note: Since the decision node “gates” control flow, it must be provided with an incoming control token. Note: Since the decision node “gates” control flow, it must be provided with an incoming control token. Added in fUML 1.3 Added in fUML 1.3
  • 27. Page 27 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Structured Nodes card = 'Select Credit Card'(); do { charge = 'Create Credit Card Charge'(card); if ('Check Charge Approval'(charge)) { 'Notify Customer of Approval'(charge); declined = false; } else { 'Notify Customer of Denial'(charge); declined = true; } } while (declined); card = 'Select Credit Card'(); do { charge = 'Create Credit Card Charge'(card); if ('Check Charge Approval'(charge)) { 'Notify Customer of Approval'(charge); declined = false; } else { 'Notify Customer of Denial'(charge); declined = true; } } while (declined); A structured node is an activity node used to group subordinate nodes into a control structure. A structured node is an activity node used to group subordinate nodes into a control structure. An loop node iterates the execution of its body while a condition is true. An loop node iterates the execution of its body while a condition is true. By default, the condition is tested after execution of the body. By default, the condition is tested after execution of the body. A conditional node executes one clause or another based on the result of a test (or tests). A conditional node executes one clause or another based on the result of a test (or tests). Inputs to the loop node initialize loop variables available across all iterations of the loop. Inputs to the loop node initialize loop variables available across all iterations of the loop. Note: There is no normative UML graphical notation for loop or conditional nodes. Note: There is no normative UML graphical notation for loop or conditional nodes. break; true Alf also provides a traditional break statement. Alf also provides a traditional break statement.
  • 28. Page 28 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Expansion Regions 'Get Outstanding Orders'(customer) -> select order ('Is Delinquent?'(order)) -> iterate order ('Refer for Collection'(order)); 'Get Outstanding Orders'(customer) -> select order ('Is Delinquent?'(order)) -> iterate order ('Refer for Collection'(order)); An expansion region is used to apply subordinate actions on all members of an input collection An expansion region is used to apply subordinate actions on all members of an input collection A parallel expansion region applies nested behavior concurrently to all collection elements. A parallel expansion region applies nested behavior concurrently to all collection elements. An iterative expansion region applies nested behavior sequentially to all collection elements. An iterative expansion region applies nested behavior sequentially to all collection elements. Alf provides specialized notation that maps to typical uses of expansion regions. Alf provides specialized notation that maps to typical uses of expansion regions.
  • 29. Page 29 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Reduction A reduction action “inserts” a binary function between the elements of a sequence of values. A reduction action “inserts” a binary function between the elements of a sequence of values. this.totalAmount = this.lineItems.amount->reduce MoneyFunctions::Add; this.totalAmount = this.lineItems.amount->reduce MoneyFunctions::Add; this.totalAmount = this.lineItems.amount->reduce MoneyFunctions::Add ?? new Money(0, 0); this.totalAmount = this.lineItems.amount->reduce MoneyFunctions::Add ?? new Money(0, 0); This is shorthand for “this.lineItems->collect item (item.amount)”. This is shorthand for “this.lineItems->collect item (item.amount)”. If the input sequence is empty, then reduction results in “null” (the empty sequence). An Alf null-coalescing expression can be used to provide a default value for this case. (Corresponding UML not shown.) If the input sequence is empty, then reduction results in “null” (the empty sequence). An Alf null-coalescing expression can be used to provide a default value for this case. (Corresponding UML not shown.)
  • 30. Page 30 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 B. Actions • Invocation Actions • Object Actions • Structural Feature Actions • Link Actions NOTE: Some of these actions will be discussed in more detail later.NOTE: Some of these actions will be discussed in more detail later.
  • 31. Page 31 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Invocation Actions • Call Behavior – Calling an activity – Calling a primitive behavior • Call Operation • Send Signal • Accept Event PlaceOrder(customer, product) Max(throttle, limit) count + quantity order.addProduct(product, quantity) vehicle.EngageBrake(pressure) accept (signal: EngageBrake)
  • 32. Page 32 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Object Actions • Value Specification • Create Object • Destroy Object • Test Identity • Read Self • Read Extent • Read Is Classified Object • Reclassify Object 1 true "Hello" new Order() order.destroy() order == myOrder name != customerName this Order.allInstances() vehicle instanceof Car car hastype Hatchback reclassify order from PendingOrder to ClosedOrder
  • 33. Page 33 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Structural Feature Actions • Read Structural Feature • Add Structural Feature Value • Remove Structural Feature Value • Clear Structural Feature Value order.customer order.datePlaced = today order.lineItems->add(item) order.lineItems->addAt(1,item) order.lineItems->remove(item) order.lineItems->removeAt(1) order.card = null
  • 34. Page 34 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Link Actions • Read Link • Create Link • Destroy Link • Clear Association Owns.person(house=>thisHouse) thisHouse.person Owns.addLink(person=>jack, house=>newHouse) Owns.removeLink(person=>jack, house=>oldHouse) Owns.clearAssoc(jack)
  • 35. Page 35 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Computation • Indexing (from 1 , not 0) • Increment/Decrement • Arithmetic/Logic • Comparison • Conditional • Isolation order.lineItems[i] order.lineItems->at(i) index++ ++count total + value address & mask total > threshold index <= count count != 0 && total/count > limit count < min || count > max $this.sensor.getReading().value
  • 36. Page 36 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 C. Structure • Structural and Behavioral Models • Classes • Associations
  • 37. Page 37 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Structural and Behavioral Models • A structural model (e.g., a class model) specifies the relevant (types of) instances in a domain that may exist at any one point in time. – Structural semantics define how a structural model constrains allowable instances. • A behavioral model (e.g., an activity model) specifies behavior over time – Behavioral semantics define how a behavioral model changes the state of instances over time.
  • 38. Page 38 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Classes • Attributes • Data Types • Primitive Types • Operations and Methods • Structural Semantics • Behavioral Semantics A class is a classifier of objects that persist in the extent of the class, with an identity that is independent of the value of their attributes at any one time. A class is a classifier of objects that persist in the extent of the class, with an identity that is independent of the value of their attributes at any one time.
  • 39. Page 39 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Classes and Attributes A class may have attributes whose types are primitive, data types or other classes. A class may have attributes whose types are primitive, data types or other classes. A referential attribute, whose type is a class, is conventionally notated as an association with a class- owned association end. A referential attribute, whose type is a class, is conventionally notated as an association with a class- owned association end. A bidirectional association results in corresponding referential attributes on both associated classes. A bidirectional association results in corresponding referential attributes on both associated classes.
  • 40. Page 40 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Data Types A data type is a classifier of transient data values whose identity is based on the values of their attributes. A data type is a classifier of transient data values whose identity is based on the values of their attributes. Data types may have attributes, but not operations. Data types may have attributes, but not operations.
  • 41. Page 41 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Primitive Types • From UML 2.4.1 PrimitiveTypes Package – Boolean – Integer – Real – UnlimitedNatural – String Used since fUML 1.1 Used since fUML 1.1
  • 42. Page 42 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Classes: Operations and Methods An operation specifies a behavior that may be synchronously invoked on an instance of a class. An operation specifies a behavior that may be synchronously invoked on an instance of a class. A method defines the actual behavior that is invoked. A method defines the actual behavior that is invoked.
  • 43. Page 43 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Classes: Structural Semantics Structural semantics specify how a structural model constrains allowable instances. Structural semantics specify how a structural model constrains allowable instances. Objects are instances of classes with values for each attribute. Objects are instances of classes with values for each attribute. Class-owned association ends are structural features with values, like attributes. Class-owned association ends are structural features with values, like attributes. fUML does not actually give semantics to an association with class-owned ends, only to the ends as structural features. fUML does not actually give semantics to an association with class-owned ends, only to the ends as structural features. Note: fUML does provide “reified” semantics for associations that own their own ends, as will be discussed later. Note: fUML does provide “reified” semantics for associations that own their own ends, as will be discussed later.
  • 44. Page 44 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Classes: Behavioral Semantics • Creating an Order • Adding a Line Item • Canceling an Order Behavioral semantics specify how a behavioral model changes the state of instances over time. Behavioral semantics specify how a behavioral model changes the state of instances over time.
  • 45. Page 45 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Creating an Order order = new Order (customer, today) Before After @Create public Order (in customer: Customer, in datePlaced: Date) { this.datePlaced = datePlaced; this.totalAmount = new Money(dollars=>0, cents=>0); this.customer = customer; this.customer.orders->add(this); } @Create public Order (in customer: Customer, in datePlaced: Date) { this.datePlaced = datePlaced; this.totalAmount = new Money(dollars=>0, cents=>0); this.customer = customer; this.customer.orders->add(this); } A new object is created and the constructor operation is invoked. A new object is created and the constructor operation is invoked. The constructor initializes the new order’s attribute values… The constructor initializes the new order’s attribute values… …and adds the order to the customer’s list. …and adds the order to the customer’s list.
  • 46. Page 46 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Adding a Line Item Before After order.addProduct (product, 2) public addProduct (in product: Product, in quantity: Integer) { lineItem = new LineItem(product, quantity); this.lineItems->add(lineItem); this.totalAmount = MoneyFunctions::Add (this.totalAmount, lineItem.amount); } public addProduct (in product: Product, in quantity: Integer) { lineItem = new LineItem(product, quantity); this.lineItems->add(lineItem); this.totalAmount = MoneyFunctions::Add (this.totalAmount, lineItem.amount); } The method for the operation creates a new line item object… The method for the operation creates a new line item object… The addProduct operation is invoked on an existing Order object. The addProduct operation is invoked on an existing Order object. …adds the new object to the list of line items for the order… …adds the new object to the list of line items for the order… …and updates the total order amount. …and updates the total order amount.
  • 47. Page 47 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Canceling an Order Before After order.cancel() @Destroy public cancel() { this.customer.orders->remove(this); } @Destroy public cancel() { this.customer.orders->remove(this); } A destructor operation is invoked, after which the order object is destroyed. A destructor operation is invoked, after which the order object is destroyed. Because line items are aggregated by composition, they are destroyed, too. Because line items are aggregated by composition, they are destroyed, too. References to the destroyed object must be explicitly removed. References to the destroyed object must be explicitly removed.
  • 48. Page 48 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Associations • Classes and Associations • Structural Semantics • Behavioral Semantics An association is a classifier whose instances are links that relate other instances. An association is a classifier whose instances are links that relate other instances.
  • 49. Page 49 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Classes and Associations An association (that owns its ends) is a classifier of persistent links between the associated classes, which exist in the extent of the association. An association (that owns its ends) is a classifier of persistent links between the associated classes, which exist in the extent of the association.
  • 50. Page 50 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Associations: Structural Semantics Links are now semantic instances of the indicated associations. Links are now semantic instances of the indicated associations. Structural semantics specify how a structural model constrains allowable instance models. Structural semantics specify how a structural model constrains allowable instance models.
  • 51. Page 51 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Associations: Behavioral Semantics • Creating an Order (revised) • Canceling an Order (revised) Behavioral semantics specify how a behavioral model changes the state of instances over time. Behavioral semantics specify how a behavioral model changes the state of instances over time.
  • 52. Page 52 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Creating an Order (revised) order = new Order (customer, today) Before After @Create public Order (in customer: Customer, in datePlaced: Date) { this.datePlaced = datePlaced; this.totalAmount = new Money(dollars=>0, cents=>0); Customer_Order.addLink(customer, this); } @Create public Order (in customer: Customer, in datePlaced: Date) { this.datePlaced = datePlaced; this.totalAmount = new Money(dollars=>0, cents=>0); Customer_Order.addLink(customer, this); } A single action creates a bidirectional link. A single action creates a bidirectional link.
  • 53. Page 53 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Canceling an Order (revised) Before After order.cancel() @Destroy public cancel() { } @Destroy public cancel() { } A destructor operation is invoked, after which the order object is destroyed. A destructor operation is invoked, after which the order object is destroyed. Links in which the destroyed object participates are now also automatically destroyed. Links in which the destroyed object participates are now also automatically destroyed.
  • 54. Page 54 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 D. Asynchronous Communication • Signals and Receptions • Classifier Behaviors • Asynchronous Behavior
  • 55. Page 55 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Signals and Receptions A signal is a classifier whose instances may be communicated asynchronously. A signal is a classifier whose instances may be communicated asynchronously. A reception is a declaration of the ability to receive a signal. A reception is a declaration of the ability to receive a signal. A signal may have attributes that represent transmittable data. A signal may have attributes that represent transmittable data. More than one class can receive the same signal. More than one class can receive the same signal.
  • 56. Page 56 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Classifier Behaviors An active class is one that has a classifier behavior. Only active class may receive signals. An active class is one that has a classifier behavior. Only active class may receive signals. A classifier behavior is an autonomous behavior started when an active class is instantiated. A classifier behavior is an autonomous behavior started when an active class is instantiated.
  • 57. Page 57 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Asynchronous Behavior accept (submission: SubmitCharge); card = submission.card; do { new CreditCardCharge(card, this); accept (response: ChargeApproved) { this.customer.ChargeApproved(response.charge); break; } or accept (response: ChargeDeclined) { this.customer.ChargeDeclined(response.charge); } while (true); accept (submission: SubmitCharge); card = submission.card; do { new CreditCardCharge(card, this); accept (response: ChargeApproved) { this.customer.ChargeApproved(response.charge); break; } or accept (response: ChargeDeclined) { this.customer.ChargeDeclined(response.charge); } while (true); The order object accepts a signal to submit a charge. The order object accepts a signal to submit a charge. The order object creates a new credit card charge object, which begins its asynchronous behavior. The order object creates a new credit card charge object, which begins its asynchronous behavior. Note: UML semantics require a separate action to start the behavior of a new object. However, Alf notation for creating an active class maps to both create and start object behavior actions. Note: UML semantics require a separate action to start the behavior of a new object. However, Alf notation for creating an active class maps to both create and start object behavior actions. The order object accepts a signal from the charge object that the charge is approved. The order object accepts a signal from the charge object that the charge is approved.The order object sends a signal to the customer that the charge is approved. The order object sends a signal to the customer that the charge is approved.
  • 58. Page 58 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 III. Standard Model Library • Primitive Behaviors • Collection Functions • Collection Classes • Basic Input/Output
  • 59. Page 59 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Primitive Behaviors • Integer Functions – Arithmetic, Comparison, Conversion • Unlimited Natural Functions – Comparison, Conversion • Boolean Functions – Logical Operations, Conversion • Bit String Functions – Bit-wise operations, Conversion • String Functions – Concatenation, Size, Substring • RealFunctions – Arithmetic, Comparison, Conversion Added in fUML 1.1Added in fUML 1.1
  • 60. Page 60 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Collection Functions Collection functions operate on sequences of values of any type. • Testing and accessing functions – Examples: seq->isEmpty(), seq1->equals(seq2), seq->at(n) • Non-mutating funtions – Examples: seq2 = seq->including(x), seq3 = seq1->union(seq2) • Mutating “in place” functions – Examples: seq->add(x), seq1->addAll(seq2), seq2->remove(x)
  • 61. Page 61 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Collection Classes Collection classes define objects that represent collections of values of a given type.
  • 62. Page 62 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Basic Input Output: Channels
  • 63. Page 63 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Basic Input Output: Reading and Writing Lines activity ReadLine (out errorStatus: Status[0..1]): String { return StandardIntputChannel.allInstances().readLine(status); } activity ReadLine (out errorStatus: Status[0..1]): String { return StandardIntputChannel.allInstances().readLine(status); } activity WriteLine (in value: String, out errorStatus: Status[0..1]) { StandardOutputChannel.allInstances().writeLine(result, status); } activity WriteLine (in value: String, out errorStatus: Status[0..1]) { StandardOutputChannel.allInstances().writeLine(result, status); }
  • 64. Page 64 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 Hello World activity Hello() { WriteLine("Hello World!"); } activity Hello() { WriteLine("Hello World!"); }
  • 65. Page 65 Copyright © 2018 Model Driven Solutions, Inc. 19 February 2018 References • Foundational UML (fUML) – Semantics of a Foundational Subset for Executable UML Models standard, http://www.omg.org/spec/FUML – fUML Open Source (Reference) Implementation Project, http://fuml.modeldriven.org/ • Action Language for fUML (Alf) – Action Language for Foundational UML (Alf) standard, http://www.omg.org/spec/ALF – Alf Open Source (Reference) Implementation Repository, http://alf.modeldriven.org/ • Contact – Email: ed-s@modeldriven.com – Twitter: @seidewitz or http://twitter.com/seidewitz

Notas do Editor

  1. Basic actions