SlideShare a Scribd company logo
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 (20)

PPTX
Hands On With the Alf Action Language: Making Executable Modeling Even Easier
Ed Seidewitz
 
PPSX
Programming in UML: An Introduction to fUML and Alf
Ed Seidewitz
 
PDF
Code Generation 2014 - ALF, the Standard Programming Language for UML
Jürgen Mutschall
 
PPTX
Introduction to the OMG Systems Modeling Language (SysML), Version 2
Ed Seidewitz
 
PPTX
Argo uml
pradnya patil
 
PPTX
Precise Semantics Standards at OMG: Executing on the Vision
Ed Seidewitz
 
PPTX
UML 2.5: Specification Simplification
Ed Seidewitz
 
PPT
Adapter pattern
Shakil Ahmed
 
PPTX
Cble assignment powerpoint activity for moodle 1
LK394
 
ODP
Introduction to Eqela development
jobandesther
 
ODP
Graphical User Interface Development with Eqela
jobandesther
 
ODP
Eqela Core API and Utilities
jobandesther
 
PPTX
Chapter3: fundamental programming
Ngeam Soly
 
PPTX
Uml Diagrams for Web Developers
Dave Kelleher
 
PPT
EclipseCon 2006: Introduction to the Eclipse Modeling Framework
Dave Steinberg
 
PPTX
Eclipse Modeling Framework
Ajay K
 
PPTX
Programming in c++
sujathavvv
 
PPT
Executable UML – UML2
elliando dias
 
PPTX
London F-Sharp User Group : Don Syme on F# - 09/09/2010
Skills Matter
 
PDF
MDD with Executable UML Models
Rafael Chaves
 
Hands On With the Alf Action Language: Making Executable Modeling Even Easier
Ed Seidewitz
 
Programming in UML: An Introduction to fUML and Alf
Ed Seidewitz
 
Code Generation 2014 - ALF, the Standard Programming Language for UML
Jürgen Mutschall
 
Introduction to the OMG Systems Modeling Language (SysML), Version 2
Ed Seidewitz
 
Argo uml
pradnya patil
 
Precise Semantics Standards at OMG: Executing on the Vision
Ed Seidewitz
 
UML 2.5: Specification Simplification
Ed Seidewitz
 
Adapter pattern
Shakil Ahmed
 
Cble assignment powerpoint activity for moodle 1
LK394
 
Introduction to Eqela development
jobandesther
 
Graphical User Interface Development with Eqela
jobandesther
 
Eqela Core API and Utilities
jobandesther
 
Chapter3: fundamental programming
Ngeam Soly
 
Uml Diagrams for Web Developers
Dave Kelleher
 
EclipseCon 2006: Introduction to the Eclipse Modeling Framework
Dave Steinberg
 
Eclipse Modeling Framework
Ajay K
 
Programming in c++
sujathavvv
 
Executable UML – UML2
elliando dias
 
London F-Sharp User Group : Don Syme on F# - 09/09/2010
Skills Matter
 
MDD with Executable UML Models
Rafael Chaves
 

Similar to UML as a Programming Language (20)

PPTX
OOP, API Design and MVP
Harshith Keni
 
PPT
Unified Modeling Language (UML)
ppd1961
 
PPTX
Solid OOPS
Toshish Jawale
 
DOC
Ooad lab manual
Praseela R
 
PPTX
Unified Modeling Language
Khushboo Wadhwani
 
PPTX
Unified Modeling Language
surana college
 
PPT
UML (Hemant rajak)
hrajak5
 
PDF
Modeling software with UML
6020 peaks
 
PDF
Epic.NET: Processes, patterns and architectures
Giacomo Tesio
 
PPT
Object Oriented Analysis and Design
Anirban Majumdar
 
PDF
TI1220 Lecture 14: Domain-Specific Languages
Eelco Visser
 
PPTX
UNIT-2 OOM.pptxUNIT-2 OOM.pptxUNIT-2 OOM.pptx
22eg105n11
 
PPT
Apostila UML
landergustavo
 
PPT
Uml introduciton
Dr. C.V. Suresh Babu
 
PPSX
MDE in Practice
Abdalmassih Yakeen
 
PDF
Twins: OOP and FP
RichardWarburton
 
PPT
Uml1 concepts
Nolan Neustaeter
 
OOP, API Design and MVP
Harshith Keni
 
Unified Modeling Language (UML)
ppd1961
 
Solid OOPS
Toshish Jawale
 
Ooad lab manual
Praseela R
 
Unified Modeling Language
Khushboo Wadhwani
 
Unified Modeling Language
surana college
 
UML (Hemant rajak)
hrajak5
 
Modeling software with UML
6020 peaks
 
Epic.NET: Processes, patterns and architectures
Giacomo Tesio
 
Object Oriented Analysis and Design
Anirban Majumdar
 
TI1220 Lecture 14: Domain-Specific Languages
Eelco Visser
 
UNIT-2 OOM.pptxUNIT-2 OOM.pptxUNIT-2 OOM.pptx
22eg105n11
 
Apostila UML
landergustavo
 
Uml introduciton
Dr. C.V. Suresh Babu
 
MDE in Practice
Abdalmassih Yakeen
 
Twins: OOP and FP
RichardWarburton
 
Uml1 concepts
Nolan Neustaeter
 
Ad

More from Ed Seidewitz (13)

PPTX
SysML v2 - What's the big deal, anyway?
Ed Seidewitz
 
PPTX
Leveraging Alf for SysML, Part 2: More Effective Trade Study Modeling
Ed Seidewitz
 
PPTX
The Very Model of a Modern Metamodeler
Ed Seidewitz
 
PPTX
SysML v2 and the Next Generation of Modeling Languages
Ed Seidewitz
 
PPTX
SysML v2 and MBSE: The next ten years
Ed Seidewitz
 
PPTX
Model Driven Architecture without Automation
Ed Seidewitz
 
PPTX
Using Alf with Cameo Simulation Toolkit - Part 2: Modeling
Ed Seidewitz
 
PPTX
Using Alf with Cameo Simulation Toolkit - Part 1: Basics
Ed Seidewitz
 
PPTX
Executable UML Roadmap (as of September 2014)
Ed Seidewitz
 
PPTX
Essence: A Common Ground for Flexible Methods
Ed Seidewitz
 
PPSX
Succeeding with Agile in the Federal Government: A Coach's Perspective
Ed Seidewitz
 
PPT
Models, Programs and Executable UML
Ed Seidewitz
 
PPT
Architecting Your Enterprise
Ed Seidewitz
 
SysML v2 - What's the big deal, anyway?
Ed Seidewitz
 
Leveraging Alf for SysML, Part 2: More Effective Trade Study Modeling
Ed Seidewitz
 
The Very Model of a Modern Metamodeler
Ed Seidewitz
 
SysML v2 and the Next Generation of Modeling Languages
Ed Seidewitz
 
SysML v2 and MBSE: The next ten years
Ed Seidewitz
 
Model Driven Architecture without Automation
Ed Seidewitz
 
Using Alf with Cameo Simulation Toolkit - Part 2: Modeling
Ed Seidewitz
 
Using Alf with Cameo Simulation Toolkit - Part 1: Basics
Ed Seidewitz
 
Executable UML Roadmap (as of September 2014)
Ed Seidewitz
 
Essence: A Common Ground for Flexible Methods
Ed Seidewitz
 
Succeeding with Agile in the Federal Government: A Coach's Perspective
Ed Seidewitz
 
Models, Programs and Executable UML
Ed Seidewitz
 
Architecting Your Enterprise
Ed Seidewitz
 
Ad

Recently uploaded (20)

DOCX
Import Data Form Excel to Tally Services
Tally xperts
 
PPT
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
PPTX
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
PDF
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
PPTX
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
PPTX
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PPTX
Engineering the Java Web Application (MVC)
abhishekoza1981
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
PPTX
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
PDF
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
Import Data Form Excel to Tally Services
Tally xperts
 
MergeSortfbsjbjsfk sdfik k
RafishaikIT02044
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Engineering the Java Web Application (MVC)
abhishekoza1981
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 

UML as a Programming Language

  • 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 [email protected] @seidewitz