SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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 a 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 a 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..
 

Más de 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
 

Más de 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
 

Último

Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 

Último (20)

Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 

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