SlideShare a Scribd company logo
1 of 30
UML® as a
Programming Language
Ed Seidewitz
Presented at the
Vienna University of Technology
3 December 2014
Copyright © 2014 Ed Seidewitz
UML® is a registered trademark of the Object Management Group
1
Developers provide feedback to
the architects (maybe)
Modeling is extra work (isn’t it?)
It is hard to validate the correctness of the models before development.
The developers may not follow the models, without providing feedback.
It is hard to keep the models and development artifacts in sync during
development (and maintenance).
Architects give models to developers
Developers
create artifacts
based on the
models
(maybe)
Architects
create the
models
Copyright © 2014 Ed Seidewitz 2
There are two responses
1. Code-based development
Use models for initial design, but then focus on code
Pro: Code is single source of “truth”
Con: Code is not as good for expressing design as
models.
Copyright © 2014 Ed Seidewitz 3
There are two responses
2. Model-driven development
Use models as the source artifacts for development
Pro: Models can be more easily understood and
evolved by human developers and maintainers.
Con: Model must be detailed enough to be
executable in its own right.
But is this really a “con”??
Copyright © 2014 Ed Seidewitz 4
The question Is…
If we are going to take the time to carefully
design our system using UML
Structural models
Behavioral models
Then why can’t we use these directly to
execute our system
Copyright © 2014 Ed Seidewitz 5
The answer is…we can!
Just add detailed behavior
But...
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.)
Copyright © 2014 Ed Seidewitz 6
The answer is…we can!
UML is not specified precisely enough to be executed
(at least not in a standard way).
Just add detailed behavior
But...
The Foundational UML (fUML) standard specifies
precise semantics for an executable subset of UML.
Copyright © 2014 Ed Seidewitz 7
The answer is…we can!
Graphical modeling notations are not good for
detailed programming.
Just add detailed behavior
But...
The Action Language for fUML (Alf) standard specifies
a textual action language with fUML semantics.
Copyright © 2014 Ed Seidewitz 8
Example: Property Management SOA
Graphical UML notation for
Data model
Message model
Interface and class models
Component models
Textual Alf notation for
Operation methods
Copyright © 2014 Ed Seidewitz 9
Property Data Model
Copyright © 2014 Ed Seidewitz 10
Service Request Message Model
Copyright © 2014 Ed Seidewitz 11
Service Reply Message Model
Copyright © 2014 Ed Seidewitz 12
Service Interface and Implementation
Copyright © 2014 Ed Seidewitz 13
Service Provider Component
Copyright © 2014 Ed Seidewitz 14
Composite structure and
ports are not in fUML, but
they are in the Precise
Semantics of Composite
Structure (PSCS) extension.
Operation method: establish
Copyright © 2014 Ed Seidewitz 15
/** Establish a new property record. */
activity establish (
in request: 'Property Record Establishment',
out reply: 'Property Management Success Reply' [0..1],
out error: 'Error Reply' [0..1] ) {
identifier = this.'property identifier factory'.'get next identifier'();
if (request.'property type' == 'Property Type'::personal) {
property = new 'Personal Property'::'create property'(identifier,request.name);
} else {
property = new 'Real Property'::'create property'(identifier,request.name);
}
reply = this.'create reply'(request.identifier, property);
}
Operation methods
are specified as UML
activities.
Newly created objects
persist at the current
execution locus.
Names can have
spaces or other
special characters.
Operation method: update
Copyright © 2014 Ed Seidewitz 16
/** Update the data of a property other than acquisition or disposition. */
activity update (
in request: 'Property Record Update',
out reply: 'Property Management Success Reply' [0..1],
out error: 'Error Reply' [0..1] ) {
property = Property -> select p (p.identifier == request.'property identifier');
if (property -> isEmpty()) {
error = new 'Error Reply' (
identifier => request.identifier + "/error",
'request identifier' => request.identifier,
'error code' => "PRU-001",
'error message' => "Property not found." );
} else if (property.status == 'Property Type'::disposed) {
…
} else {
if (request.'property location' -> notEmpty()) {
location = Location -> select loc
(loc.identifier == request.'property location');
'Property Location'.createLink(property, location);
}
…
}
}
A “select” maps to a
concurrent expansion
region over a class
extent.
Creating a link automatically
establishes a bidirectional
relationship.
The models are validated in a
development/test environment
We can program in UML!
The models are deployed in a production
environment
Developers
create fully
executable
models
Developers iteratively execute, test
and update the models
Copyright © 2014 Ed Seidewitz 17
Agile development…with executable models!
But why UML?
UML…
Allows abstractions closer to the
problem domain
Is already familiar to developers for
design
Has widely available
tooling
© 2014 Ed Seidewitz 18
Multi-core processing is the future
1
10
100
1 000
10 000
100 000
1 000 000
10 000 000
1975 1980 1985 1990 1995 2000 2005 2010
Transistors
(1000s)
Clock (MHz)
Copyright © 2014 Ed Seidewitz 19
Why is multi-core hard?
Traditional processor architecture
Single processor
Local registers / cache
Remote memory
Traditional programming language
Functions / procedures
Local variables / stack
Heap memory
Traditional modeling language
Things / Relationships
Events / Behaviors
Communication
Automatic
compilation
Human
implementation
Copyright © 2014 Ed Seidewitz 20
Why is multi-core hard?
Traditional processor architecture
Single processor
Local registers / cache
Remote memory
Traditional programming language
Functions / procedures
Local variables / stack
Heap memory
Traditional modeling language
Things / Relationships
Events / Behaviors
Communication
Multi-core processor architecture
Many processors
Much local memory
Global memory (?)
Concurrency is
natural here
Concurrency is
natural here
Concurrency is
NOT natural here!
Copyright © 2014 Ed Seidewitz 21
from Oracle presentation “Divide and Conquer
Parallelism with the Fork/Join Framework”
What makes it easier?
Result solve(Problem p) {
if (p.size() < SEQUENTIAL_THRESHOLD
{
return p.solveSequentially();
} else {
Result left, right;
INVOKE-IN-PARALLEL
{ left = solve(p.leftHalf());
right = solve(p.rightHalf());
}
return combine(left, right);
}
}
Pseudo-code
Divide and conquer (fork/join)
Copyright © 2014 Ed Seidewitz 22
from Oracle presentation “Divide and Conquer
Parallelism with the Fork/Join Framework”
What makes it easier?
Result solve(Problem p) {
if (p.size() < SEQUENTIAL_THRESHOLD
{
return p.solveSequentially();
} else {
Result left, right;
INVOKE-IN-PARALLEL
{ left = solve(p.leftHalf());
right = solve(p.rightHalf());
}
return combine(left, right);
}
}
class SolutionTask
extends
RecursiveAction {
Problem p;
SolutionTask(
Problem p) {…}
void compute() {SolutionTask left =
new SolutionTask(…);
SolutionTask right=
new SolutionTask(…);
invokeAll(left, right);
Java
Divide and conquer (fork/join)
Copyright © 2014 Ed Seidewitz 23
What makes it easier?
Result solve(Problem p) {
if (p.size() < SEQUENTIAL_THRESHOLD
{
return p.solveSequentially();
} else {
//@parallel
{ left = solve(p.leftHalf());
right = solve(p.rightHalf());
}
return combine(left, right);
}
}
solve(in p: Problem): Result {
Alf UML
«structured»
«structured»
«structured»
Divide and conquer (fork/join)
Copyright © 2014 Ed Seidewitz 24
What makes it easier?
Bulk data (select/map/reduce)
data->select x (filter(x))->collect x (map(x))->reduce combine
Alf
map
«parallel»
filter
«parallel»
«reduce»
combine
UML
Copyright © 2014 Ed Seidewitz 25
What makes it easier?
Asynchronous objects (actors)
GetAuthorization
ChargeApproved
new
CreditCardCharge
ChargeApproved
ChargeDenied
Copyright © 2014 Ed Seidewitz 26
But why UML?
Why not
Clojure
Scala F++
Haskell
Erlang
These all require new ways of
thinking about coding
…
Copyright © 2014 Ed Seidewitz 27
But why UML?
UML…
Allows abstractions closer to the
problem domain
Is already familiar to developers for
design
Has widely available
tooling
Copyright © 2014 Ed Seidewitz 28
Deals with concurrency in the
UML as a Programming Language
© 2014 Ed Seidewitz 29
LieberLieber AM|USE
for Sparx Enterprise Architect
http://www.lieberlieber.com/model-engineering/amuse
NoMagic Cameo Simulation Toolkit
for MagicDraw
https://www.magicdraw.com/simulation
Moka Model Execution Engine
for Eclipse Papyrus (open source)
https://wiki.eclipse.org/Papyrus/UserGuide/ModelExecution
UML as a Programming Language
© 2014 Ed Seidewitz 30
fUML Open Source Reference Implementation
http://fuml.modeldriven.org
(see also http://www.modelexecution.org)
Alf Open Source Reference Implementation
http://alf.modeldriven.org
Unified Modeling Language
http://www.uml.org
Ed Seidewitz
ed-s@modeldriven.com
@seidewitz

More Related Content

What's hot

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
 
Programming in UML: An Introduction to fUML and Alf
Programming in UML: An Introduction to fUML and AlfProgramming in UML: An Introduction to fUML and Alf
Programming in UML: An Introduction to fUML and AlfEd Seidewitz
 
Code Generation 2014 - ALF, the Standard Programming Language for UML
Code Generation 2014  - ALF, the Standard Programming Language for UMLCode Generation 2014  - ALF, the Standard Programming Language for UML
Code Generation 2014 - ALF, the Standard Programming Language for UMLJürgen Mutschall
 
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
 
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 2.5: Specification Simplification
UML 2.5: Specification SimplificationUML 2.5: Specification Simplification
UML 2.5: Specification SimplificationEd Seidewitz
 
Cble assignment powerpoint activity for moodle 1
Cble assignment powerpoint activity for moodle 1Cble assignment powerpoint activity for moodle 1
Cble assignment powerpoint activity for moodle 1LK394
 
Introduction to Eqela development
Introduction to Eqela developmentIntroduction to Eqela development
Introduction to Eqela developmentjobandesther
 
Graphical User Interface Development with Eqela
Graphical User Interface Development with EqelaGraphical User Interface Development with Eqela
Graphical User Interface Development with Eqelajobandesther
 
Eqela Core API and Utilities
Eqela Core API and UtilitiesEqela Core API and Utilities
Eqela Core API and Utilitiesjobandesther
 
Chapter3: fundamental programming
Chapter3: fundamental programmingChapter3: fundamental programming
Chapter3: fundamental programmingNgeam Soly
 
Uml Diagrams for Web Developers
Uml Diagrams for Web DevelopersUml Diagrams for Web Developers
Uml Diagrams for Web DevelopersDave Kelleher
 
EclipseCon 2006: Introduction to the Eclipse Modeling Framework
EclipseCon 2006: Introduction to the Eclipse Modeling FrameworkEclipseCon 2006: Introduction to the Eclipse Modeling Framework
EclipseCon 2006: Introduction to the Eclipse Modeling FrameworkDave Steinberg
 
Eclipse Modeling Framework
Eclipse Modeling FrameworkEclipse Modeling Framework
Eclipse Modeling FrameworkAjay K
 
Programming in c++
Programming in c++Programming in c++
Programming in c++sujathavvv
 
Executable UML – UML2
Executable UML – UML2Executable UML – UML2
Executable UML – UML2elliando dias
 
London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010Skills Matter
 
MDD with Executable UML Models
MDD with Executable UML ModelsMDD with Executable UML Models
MDD with Executable UML ModelsRafael Chaves
 

What's hot (20)

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
 
Programming in UML: An Introduction to fUML and Alf
Programming in UML: An Introduction to fUML and AlfProgramming in UML: An Introduction to fUML and Alf
Programming in UML: An Introduction to fUML and Alf
 
Code Generation 2014 - ALF, the Standard Programming Language for UML
Code Generation 2014  - ALF, the Standard Programming Language for UMLCode Generation 2014  - ALF, the Standard Programming Language for UML
Code Generation 2014 - ALF, the Standard Programming Language for UML
 
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
 
Argo uml
Argo umlArgo uml
Argo uml
 
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 2.5: Specification Simplification
UML 2.5: Specification SimplificationUML 2.5: Specification Simplification
UML 2.5: Specification Simplification
 
Adapter pattern
Adapter patternAdapter pattern
Adapter pattern
 
Cble assignment powerpoint activity for moodle 1
Cble assignment powerpoint activity for moodle 1Cble assignment powerpoint activity for moodle 1
Cble assignment powerpoint activity for moodle 1
 
Introduction to Eqela development
Introduction to Eqela developmentIntroduction to Eqela development
Introduction to Eqela development
 
Graphical User Interface Development with Eqela
Graphical User Interface Development with EqelaGraphical User Interface Development with Eqela
Graphical User Interface Development with Eqela
 
Eqela Core API and Utilities
Eqela Core API and UtilitiesEqela Core API and Utilities
Eqela Core API and Utilities
 
Chapter3: fundamental programming
Chapter3: fundamental programmingChapter3: fundamental programming
Chapter3: fundamental programming
 
Uml Diagrams for Web Developers
Uml Diagrams for Web DevelopersUml Diagrams for Web Developers
Uml Diagrams for Web Developers
 
EclipseCon 2006: Introduction to the Eclipse Modeling Framework
EclipseCon 2006: Introduction to the Eclipse Modeling FrameworkEclipseCon 2006: Introduction to the Eclipse Modeling Framework
EclipseCon 2006: Introduction to the Eclipse Modeling Framework
 
Eclipse Modeling Framework
Eclipse Modeling FrameworkEclipse Modeling Framework
Eclipse Modeling Framework
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
 
Executable UML – UML2
Executable UML – UML2Executable UML – UML2
Executable UML – UML2
 
London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010
 
MDD with Executable UML Models
MDD with Executable UML ModelsMDD with Executable UML Models
MDD with Executable UML Models
 

Similar to UML as a Programming Language: Executable Models for Concurrency

Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstEnea Gabriel
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)Chiew Carol
 
Java Programming
Java ProgrammingJava Programming
Java ProgrammingTracy Clark
 
Architecture refactoring - accelerating business success
Architecture refactoring - accelerating business successArchitecture refactoring - accelerating business success
Architecture refactoring - accelerating business successGanesh Samarthyam
 
Evolve Your Code
Evolve Your CodeEvolve Your Code
Evolve Your CodeRookieOne
 
Demystifying dot NET reverse engineering - Part1
Demystifying  dot NET reverse engineering - Part1Demystifying  dot NET reverse engineering - Part1
Demystifying dot NET reverse engineering - Part1Soufiane Tahiri
 
Eclipse e4 Overview
Eclipse e4 OverviewEclipse e4 Overview
Eclipse e4 OverviewLars Vogel
 
The First C# Project Analyzed
The First C# Project AnalyzedThe First C# Project Analyzed
The First C# Project AnalyzedPVS-Studio
 
Design Patterns - Part 1 of 2
Design Patterns - Part 1 of 2Design Patterns - Part 1 of 2
Design Patterns - Part 1 of 2Savio Sebastian
 
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...Codemotion
 
Eclipse BPEL Designer
Eclipse BPEL DesignerEclipse BPEL Designer
Eclipse BPEL Designermilliger
 
Eclipse BPEL Designer
Eclipse BPEL DesignerEclipse BPEL Designer
Eclipse BPEL Designermilliger
 
Choose'10: Ralf Laemmel - Dealing Confortably with the Confusion of Tongues
Choose'10: Ralf Laemmel - Dealing Confortably with the Confusion of TonguesChoose'10: Ralf Laemmel - Dealing Confortably with the Confusion of Tongues
Choose'10: Ralf Laemmel - Dealing Confortably with the Confusion of TonguesCHOOSE
 
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..Mark Rackley
 

Similar to UML as a Programming Language: Executable Models for Concurrency (20)

Thinking In Swift
Thinking In SwiftThinking In Swift
Thinking In Swift
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code First
 
Refactoring
RefactoringRefactoring
Refactoring
 
Robots in Swift
Robots in SwiftRobots in Swift
Robots in Swift
 
Rspec
RspecRspec
Rspec
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Refactoring
RefactoringRefactoring
Refactoring
 
Architecture refactoring - accelerating business success
Architecture refactoring - accelerating business successArchitecture refactoring - accelerating business success
Architecture refactoring - accelerating business success
 
Evolve Your Code
Evolve Your CodeEvolve Your Code
Evolve Your Code
 
Demystifying dot NET reverse engineering - Part1
Demystifying  dot NET reverse engineering - Part1Demystifying  dot NET reverse engineering - Part1
Demystifying dot NET reverse engineering - Part1
 
Eclipse e4 Overview
Eclipse e4 OverviewEclipse e4 Overview
Eclipse e4 Overview
 
The First C# Project Analyzed
The First C# Project AnalyzedThe First C# Project Analyzed
The First C# Project Analyzed
 
L04 Software Design Examples
L04 Software Design ExamplesL04 Software Design Examples
L04 Software Design Examples
 
Design Patterns - Part 1 of 2
Design Patterns - Part 1 of 2Design Patterns - Part 1 of 2
Design Patterns - Part 1 of 2
 
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
 
Eclipse BPEL Designer
Eclipse BPEL DesignerEclipse BPEL Designer
Eclipse BPEL Designer
 
Eclipse BPEL Designer
Eclipse BPEL DesignerEclipse BPEL Designer
Eclipse BPEL Designer
 
Choose'10: Ralf Laemmel - Dealing Confortably with the Confusion of Tongues
Choose'10: Ralf Laemmel - Dealing Confortably with the Confusion of TonguesChoose'10: Ralf Laemmel - Dealing Confortably with the Confusion of Tongues
Choose'10: Ralf Laemmel - Dealing Confortably with the Confusion of Tongues
 
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
 

More from Ed Seidewitz

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
 
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
 
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
 
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 2: Modeling
Using Alf with Cameo Simulation Toolkit - Part 2: ModelingUsing Alf with Cameo Simulation Toolkit - Part 2: Modeling
Using Alf with Cameo Simulation Toolkit - Part 2: ModelingEd 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
 
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
 
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
 

More from Ed Seidewitz (13)

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?
 
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
 
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
 
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 2: Modeling
Using Alf with Cameo Simulation Toolkit - Part 2: ModelingUsing Alf with Cameo Simulation Toolkit - Part 2: Modeling
Using Alf with Cameo Simulation Toolkit - Part 2: Modeling
 
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
 
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
 
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
 

Recently uploaded

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
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
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
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
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 Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
+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
 
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.
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...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
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
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
 
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
 
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
 
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
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
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
 

Recently uploaded (20)

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
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
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
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
+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...
 
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 ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
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-...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
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...
 
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
 
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
 
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...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
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
 

UML as a Programming Language: Executable Models for Concurrency

  • 1. UML® as a Programming Language Ed Seidewitz Presented at the Vienna University of Technology 3 December 2014 Copyright © 2014 Ed Seidewitz UML® is a registered trademark of the Object Management Group 1
  • 2. Developers provide feedback to the architects (maybe) Modeling is extra work (isn’t it?) It is hard to validate the correctness of the models before development. The developers may not follow the models, without providing feedback. It is hard to keep the models and development artifacts in sync during development (and maintenance). Architects give models to developers Developers create artifacts based on the models (maybe) Architects create the models Copyright © 2014 Ed Seidewitz 2
  • 3. There are two responses 1. Code-based development Use models for initial design, but then focus on code Pro: Code is single source of “truth” Con: Code is not as good for expressing design as models. Copyright © 2014 Ed Seidewitz 3
  • 4. There are two responses 2. Model-driven development Use models as the source artifacts for development Pro: Models can be more easily understood and evolved by human developers and maintainers. Con: Model must be detailed enough to be executable in its own right. But is this really a “con”?? Copyright © 2014 Ed Seidewitz 4
  • 5. The question Is… If we are going to take the time to carefully design our system using UML Structural models Behavioral models Then why can’t we use these directly to execute our system Copyright © 2014 Ed Seidewitz 5
  • 6. The answer is…we can! Just add detailed behavior But... 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.) Copyright © 2014 Ed Seidewitz 6
  • 7. The answer is…we can! UML is not specified precisely enough to be executed (at least not in a standard way). Just add detailed behavior But... The Foundational UML (fUML) standard specifies precise semantics for an executable subset of UML. Copyright © 2014 Ed Seidewitz 7
  • 8. The answer is…we can! Graphical modeling notations are not good for detailed programming. Just add detailed behavior But... The Action Language for fUML (Alf) standard specifies a textual action language with fUML semantics. Copyright © 2014 Ed Seidewitz 8
  • 9. Example: Property Management SOA Graphical UML notation for Data model Message model Interface and class models Component models Textual Alf notation for Operation methods Copyright © 2014 Ed Seidewitz 9
  • 10. Property Data Model Copyright © 2014 Ed Seidewitz 10
  • 11. Service Request Message Model Copyright © 2014 Ed Seidewitz 11
  • 12. Service Reply Message Model Copyright © 2014 Ed Seidewitz 12
  • 13. Service Interface and Implementation Copyright © 2014 Ed Seidewitz 13
  • 14. Service Provider Component Copyright © 2014 Ed Seidewitz 14 Composite structure and ports are not in fUML, but they are in the Precise Semantics of Composite Structure (PSCS) extension.
  • 15. Operation method: establish Copyright © 2014 Ed Seidewitz 15 /** Establish a new property record. */ activity establish ( in request: 'Property Record Establishment', out reply: 'Property Management Success Reply' [0..1], out error: 'Error Reply' [0..1] ) { identifier = this.'property identifier factory'.'get next identifier'(); if (request.'property type' == 'Property Type'::personal) { property = new 'Personal Property'::'create property'(identifier,request.name); } else { property = new 'Real Property'::'create property'(identifier,request.name); } reply = this.'create reply'(request.identifier, property); } Operation methods are specified as UML activities. Newly created objects persist at the current execution locus. Names can have spaces or other special characters.
  • 16. Operation method: update Copyright © 2014 Ed Seidewitz 16 /** Update the data of a property other than acquisition or disposition. */ activity update ( in request: 'Property Record Update', out reply: 'Property Management Success Reply' [0..1], out error: 'Error Reply' [0..1] ) { property = Property -> select p (p.identifier == request.'property identifier'); if (property -> isEmpty()) { error = new 'Error Reply' ( identifier => request.identifier + "/error", 'request identifier' => request.identifier, 'error code' => "PRU-001", 'error message' => "Property not found." ); } else if (property.status == 'Property Type'::disposed) { … } else { if (request.'property location' -> notEmpty()) { location = Location -> select loc (loc.identifier == request.'property location'); 'Property Location'.createLink(property, location); } … } } A “select” maps to a concurrent expansion region over a class extent. Creating a link automatically establishes a bidirectional relationship.
  • 17. The models are validated in a development/test environment We can program in UML! The models are deployed in a production environment Developers create fully executable models Developers iteratively execute, test and update the models Copyright © 2014 Ed Seidewitz 17 Agile development…with executable models!
  • 18. But why UML? UML… Allows abstractions closer to the problem domain Is already familiar to developers for design Has widely available tooling © 2014 Ed Seidewitz 18
  • 19. Multi-core processing is the future 1 10 100 1 000 10 000 100 000 1 000 000 10 000 000 1975 1980 1985 1990 1995 2000 2005 2010 Transistors (1000s) Clock (MHz) Copyright © 2014 Ed Seidewitz 19
  • 20. Why is multi-core hard? Traditional processor architecture Single processor Local registers / cache Remote memory Traditional programming language Functions / procedures Local variables / stack Heap memory Traditional modeling language Things / Relationships Events / Behaviors Communication Automatic compilation Human implementation Copyright © 2014 Ed Seidewitz 20
  • 21. Why is multi-core hard? Traditional processor architecture Single processor Local registers / cache Remote memory Traditional programming language Functions / procedures Local variables / stack Heap memory Traditional modeling language Things / Relationships Events / Behaviors Communication Multi-core processor architecture Many processors Much local memory Global memory (?) Concurrency is natural here Concurrency is natural here Concurrency is NOT natural here! Copyright © 2014 Ed Seidewitz 21
  • 22. from Oracle presentation “Divide and Conquer Parallelism with the Fork/Join Framework” What makes it easier? Result solve(Problem p) { if (p.size() < SEQUENTIAL_THRESHOLD { return p.solveSequentially(); } else { Result left, right; INVOKE-IN-PARALLEL { left = solve(p.leftHalf()); right = solve(p.rightHalf()); } return combine(left, right); } } Pseudo-code Divide and conquer (fork/join) Copyright © 2014 Ed Seidewitz 22
  • 23. from Oracle presentation “Divide and Conquer Parallelism with the Fork/Join Framework” What makes it easier? Result solve(Problem p) { if (p.size() < SEQUENTIAL_THRESHOLD { return p.solveSequentially(); } else { Result left, right; INVOKE-IN-PARALLEL { left = solve(p.leftHalf()); right = solve(p.rightHalf()); } return combine(left, right); } } class SolutionTask extends RecursiveAction { Problem p; SolutionTask( Problem p) {…} void compute() {SolutionTask left = new SolutionTask(…); SolutionTask right= new SolutionTask(…); invokeAll(left, right); Java Divide and conquer (fork/join) Copyright © 2014 Ed Seidewitz 23
  • 24. What makes it easier? Result solve(Problem p) { if (p.size() < SEQUENTIAL_THRESHOLD { return p.solveSequentially(); } else { //@parallel { left = solve(p.leftHalf()); right = solve(p.rightHalf()); } return combine(left, right); } } solve(in p: Problem): Result { Alf UML «structured» «structured» «structured» Divide and conquer (fork/join) Copyright © 2014 Ed Seidewitz 24
  • 25. What makes it easier? Bulk data (select/map/reduce) data->select x (filter(x))->collect x (map(x))->reduce combine Alf map «parallel» filter «parallel» «reduce» combine UML Copyright © 2014 Ed Seidewitz 25
  • 26. What makes it easier? Asynchronous objects (actors) GetAuthorization ChargeApproved new CreditCardCharge ChargeApproved ChargeDenied Copyright © 2014 Ed Seidewitz 26
  • 27. But why UML? Why not Clojure Scala F++ Haskell Erlang These all require new ways of thinking about coding … Copyright © 2014 Ed Seidewitz 27
  • 28. But why UML? UML… Allows abstractions closer to the problem domain Is already familiar to developers for design Has widely available tooling Copyright © 2014 Ed Seidewitz 28 Deals with concurrency in the
  • 29. UML as a Programming Language © 2014 Ed Seidewitz 29 LieberLieber AM|USE for Sparx Enterprise Architect http://www.lieberlieber.com/model-engineering/amuse NoMagic Cameo Simulation Toolkit for MagicDraw https://www.magicdraw.com/simulation Moka Model Execution Engine for Eclipse Papyrus (open source) https://wiki.eclipse.org/Papyrus/UserGuide/ModelExecution
  • 30. UML as a Programming Language © 2014 Ed Seidewitz 30 fUML Open Source Reference Implementation http://fuml.modeldriven.org (see also http://www.modelexecution.org) Alf Open Source Reference Implementation http://alf.modeldriven.org Unified Modeling Language http://www.uml.org Ed Seidewitz ed-s@modeldriven.com @seidewitz