SlideShare uma empresa Scribd logo
1 de 13
A Unified View of Modeling and Programming:
The Perspective from Executable UML
Presented at ISoLA 2016, Corfu, Greece
Ed Seidewitz
10 October 2016
Copyright © 2016 Ed Seidewitz
We can model that!We can model that!
What is a model?
A model is a set of statements in a modeling
language about some system under study or
domain.*
What is a program?
A program is a specification for a computation
to be a executed on a computer.
Models and Programs
* See Ed Seidewitz, “What Models Mean”, IEEE Software, September/October 2003 for more.
We can model that!We can model that!
A program is a model of the specified computation, abstracting away
from the details of how the computation is actually executed on a
computer.
A programming language is a modeling language for creating models
of execution.
All programs are models
Customer customer = customers.get(customerId);
if (customer != null) {
int totalBalance = 0;
for (Account account: customer.accounts) {
totalBalance += account.balance;
}
}
Customer customer = customers.get(customerId);
if (customer != null) {
int totalBalance = 0;
for (Account account: customer.accounts) {
totalBalance += account.balance;
}
}
Java
…and a value called
“totalBalance”…
…and a value called
“totalBalance”…
… that is iteratively computed
to be the sum of the
customer’s account balances.
… that is iteratively computed
to be the sum of the
customer’s account balances.
There is a customer identified
by “customerId”…
There is a customer identified
by “customerId”…
We can model that!
Programs can also be domain models
public class Bank {
private String bankId;
private Set<Customer> customers;
private Set<Account> accounts;
...
}
public class Bank {
private String bankId;
private Set<Customer> customers;
private Set<Account> accounts;
...
}
public class Customer {
private String customerId;
private Set<Account> accounts;
...
}
public class Customer {
private String customerId;
private Set<Account> accounts;
...
}
public class Account {
private String accountId;
private int balance = 0;
private Set<Customer> accountOwners;
...
}
public class Account {
private String accountId;
private int balance = 0;
private Set<Customer> accountOwners;
...
}
Classes are intended to reflect
domain concepts.
Classes are intended to reflect
domain concepts.
Fields reflect properties
of those concepts…
Fields reflect properties
of those concepts…
… or relationships
with other concepts.
… or relationships
with other concepts.
We can model that!
But make implementation commitments
public class Customer {
...
private Set<Account> accounts = new HashSet<Account>();
public void addAccount(Account account) {
if (account != null && !this.accounts.contains(account)) {
this.accounts.add(account);
account.addAccountOwner(this);
}
}
...
}
public class Customer {
...
private Set<Account> accounts = new HashSet<Account>();
public void addAccount(Account account) {
if (account != null && !this.accounts.contains(account)) {
this.accounts.add(account);
account.addAccountOwner(this);
}
}
...
} public class Bank {
...
private Map<String, Account> customers = new HashMap<String, Customer>();
public Integer totalAccountBalance(String customerId) {
Integer totalBalance = null;
Customer customer = this.customers.get(customerId);
if (customer != null) {
totalBalance = 0;
for (Account account: customer.accounts) {
totalBalance += account.balance;
}
}
return totalBalance;
}
...
}
public class Bank {
...
private Map<String, Account> customers = new HashMap<String, Customer>();
public Integer totalAccountBalance(String customerId) {
Integer totalBalance = null;
Customer customer = this.customers.get(customerId);
if (customer != null) {
totalBalance = 0;
for (Account account: customer.accounts) {
totalBalance += account.balance;
}
}
return totalBalance;
}
...
}
Pick implementation
classes for collections.
Pick implementation
classes for collections.
Deal with bidirectional
relationships.
Deal with bidirectional
relationships.
Choose representations for
efficient computation.
Choose representations for
efficient computation.
Decide on (generally sequential)
control structuring.
Decide on (generally sequential)
control structuring.
We can model that!We can model that!
UML began as a notation for models of programs.
But UML 2 has constructs that allow the specification of Turing-
complete computation models.
•Foundational UML (fUML) provides precise execution semantics.
•Action Language for fUML (Alf) provides a textual notation.
Executable UML models are programs
customer = Customer -> select c (c.customerId == customerId);
totalBalance = customer.accounts.balance -> reduce '+';
customer = Customer -> select c (c.customerId == customerId);
totalBalance = customer.accounts.balance -> reduce '+';
Alf
… and a value called “totalBalance”
that is sum of the customer’s
account balances.
… and a value called “totalBalance”
that is sum of the customer’s
account balances.
There is a customer identified
by “customerId”…
There is a customer identified
by “customerId”…
We can model that!
UML is common for domain modeling
public class Bank {
private String bankId;
private Set<Customer> customers;
private Set<Account> accounts;
...
}
public class Bank {
private String bankId;
private Set<Customer> customers;
private Set<Account> accounts;
...
}
public class Customer {
private String customerId;
private Set<Account> accounts;
...
}
public class Customer {
private String customerId;
private Set<Account> accounts;
...
}
public class Account {
private String accountId;
private int balance = 0;
private Set<Customer> accountOwners;
...
}
public class Account {
private String accountId;
private int balance = 0;
private Set<Customer> accountOwners;
...
}
The UML model directly
corresponds to the
program design…
The UML model directly
corresponds to the
program design…
…but abstracts away from
implementation details (like
collection classes).
…but abstracts away from
implementation details (like
collection classes).
It also shows some things
implicit in the program, like
association composition
and bidirectionality.
It also shows some things
implicit in the program, like
association composition
and bidirectionality.
We can model that!
But diagrams are just notation
class Bank {
public bankId: String;
public customers: compose Customer[*];
public accounts: compose Account[*];
}
class Bank {
public bankId: String;
public customers: compose Customer[*];
public accounts: compose Account[*];
}
assoc AccountOwnership {
public accountOwners: Customer[*];
public accounts: Account[*];
}
assoc AccountOwnership {
public accountOwners: Customer[*];
public accounts: Account[*];
} class Account {
public accountId: String;
public balance: Integer = 0;
}
class Account {
public accountId: String;
public balance: Integer = 0;
}
class Customer {
public customerId: String;
}
class Customer {
public customerId: String;
}
A UML class model has
semantics independent of its
mapping to any other language…
A UML class model has
semantics independent of its
mapping to any other language…
…which can be
notated textually as
well as graphically.
…which can be
notated textually as
well as graphically.
We can model that!
Computation can be modeled, too
class Bank {
public bankId: String;
public customers: compose Customer[*];
public accounts: compose Account[*];
public totalAccountBalance(in customerId: String): Integer[0..1] {
customer = this.customers -> select c (c.customerId == customerId);
return customer.accounts.balance -> reduce '+';
}
...
}
class Bank {
public bankId: String;
public customers: compose Customer[*];
public accounts: compose Account[*];
public totalAccountBalance(in customerId: String): Integer[0..1] {
customer = this.customers -> select c (c.customerId == customerId);
return customer.accounts.balance -> reduce '+';
}
...
} The underlying semantics are based
on data-flow, not an implicit von
Neumann architecture.
The underlying semantics are based
on data-flow, not an implicit von
Neumann architecture.
These actions are
inherently concurrent.
These actions are
inherently concurrent.
…with far fewer implementation
commitments.
…with far fewer implementation
commitments.
We can model that!
And declarative constraints, too
A UML constraint can
be specified using a
UML behavior.
A UML constraint can
be specified using a
UML behavior.
We can model that!
Allowing deductions to be made
Given the accounts of a
customer, the
totalBalance can be
derived.
Given the accounts of a
customer, the
totalBalance can be
derived.
Given the accountOwners of
an account, the owning bank
can be deduced (or
validated).
Given the accountOwners of
an account, the owning bank
can be deduced (or
validated).
We can model that!We can model that!
A combined modeling/programming language
should:
•Be designed to express both problem and
solution domain models, not just abstract
hardware computing paradigms
•Have formal semantics that allow reasoning
about models, with execution semantics for
behavioral models
•Have a textual notation for representing and
reasoning on all types of models, with graphical
notations allowing multiple views of the same
model
Combining modeling and programming
We can model that!We can model that!
• Models can be given precise semantics.
• Not all model semantics are execution
semantics.
– E.g., requirements models, architectural models,
business models…
• Some models have execution semantics, and
these are programs.
• Executable models in context of wider
modeling allows deductive or inductive
reasoning combined with execution and
testing
Why is this a good idea?

Mais conteúdo relacionado

Mais procurados

C and C++ Industrial Training Jalandhar
C and C++ Industrial Training JalandharC and C++ Industrial Training Jalandhar
C and C++ Industrial Training JalandharDreamtech Labs
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development GuideNitin Giri
 
graphics programming in java
graphics programming in javagraphics programming in java
graphics programming in javaAbinaya B
 
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
 
Visual studio 2008
Visual studio 2008Visual studio 2008
Visual studio 2008Luis Enrique
 
Applets - lev' 2
Applets - lev' 2Applets - lev' 2
Applets - lev' 2Rakesh T
 
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...NicheTech Com. Solutions Pvt. Ltd.
 
02. functions & introduction to class
02. functions & introduction to class02. functions & introduction to class
02. functions & introduction to classHaresh Jaiswal
 
C++ language basic
C++ language basicC++ language basic
C++ language basicWaqar Younis
 
OOP in C++
OOP in C++OOP in C++
OOP in C++ppd1961
 
Glimpses of C++0x
Glimpses of C++0xGlimpses of C++0x
Glimpses of C++0xppd1961
 

Mais procurados (20)

C and C++ Industrial Training Jalandhar
C and C++ Industrial Training JalandharC and C++ Industrial Training Jalandhar
C and C++ Industrial Training Jalandhar
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
 
C++ Programming
C++ ProgrammingC++ Programming
C++ Programming
 
graphics programming in java
graphics programming in javagraphics programming in java
graphics programming in java
 
C Programming
C ProgrammingC Programming
C Programming
 
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
 
Visual studio 2008
Visual studio 2008Visual studio 2008
Visual studio 2008
 
Applets - lev' 2
Applets - lev' 2Applets - lev' 2
Applets - lev' 2
 
Project two c++ tutorial
Project two c++ tutorialProject two c++ tutorial
Project two c++ tutorial
 
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
 
Basics of c++
Basics of c++Basics of c++
Basics of c++
 
Itsjustangular
ItsjustangularItsjustangular
Itsjustangular
 
02. functions & introduction to class
02. functions & introduction to class02. functions & introduction to class
02. functions & introduction to class
 
C++ book
C++ bookC++ book
C++ book
 
C++ language basic
C++ language basicC++ language basic
C++ language basic
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
 
Glimpses of C++0x
Glimpses of C++0xGlimpses of C++0x
Glimpses of C++0x
 
C programming
C programmingC programming
C programming
 
Deep C
Deep CDeep C
Deep C
 
Data types in c++
Data types in c++ Data types in c++
Data types in c++
 

Semelhante a A Unified View of Modeling and Programming

Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right wayThibaud Desodt
 
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2Philip Schwarz
 
Introduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphereIntroduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphereeLink Business Innovations
 
Introduction to Domain driven design (LaravelBA #5)
Introduction to Domain driven design (LaravelBA #5)Introduction to Domain driven design (LaravelBA #5)
Introduction to Domain driven design (LaravelBA #5)guiwoda
 
WP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a SilverlightWP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a SilverlightMICTT Palma
 
Cbsecomputersciencecclass12boardproject bankmanagmentsystem-180703065625-conv...
Cbsecomputersciencecclass12boardproject bankmanagmentsystem-180703065625-conv...Cbsecomputersciencecclass12boardproject bankmanagmentsystem-180703065625-conv...
Cbsecomputersciencecclass12boardproject bankmanagmentsystem-180703065625-conv...sriram sarwan
 
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docxCSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docxruthannemcmullen
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)pbarasia
 
Cbse computer science (c++) class 12 board project bank managment system
Cbse computer science (c++)  class 12 board project  bank managment systemCbse computer science (c++)  class 12 board project  bank managment system
Cbse computer science (c++) class 12 board project bank managment systempranoy_seenu
 
c++basics.ppt
c++basics.pptc++basics.ppt
c++basics.pptEPORI
 
Please distinguish between the .h and .cpp file, create a fully work.pdf
Please distinguish between the .h and .cpp file, create a fully work.pdfPlease distinguish between the .h and .cpp file, create a fully work.pdf
Please distinguish between the .h and .cpp file, create a fully work.pdfneerajsachdeva33
 
The Technical Debt of Programming Languages
The Technical Debt of Programming LanguagesThe Technical Debt of Programming Languages
The Technical Debt of Programming LanguagesHernan Wilkinson
 
Avoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tireAvoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tireHernan Wilkinson
 

Semelhante a A Unified View of Modeling and Programming (20)

Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
 
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
 
Introduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphereIntroduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphere
 
Introduction to Domain driven design (LaravelBA #5)
Introduction to Domain driven design (LaravelBA #5)Introduction to Domain driven design (LaravelBA #5)
Introduction to Domain driven design (LaravelBA #5)
 
The MirAL Story
The MirAL StoryThe MirAL Story
The MirAL Story
 
C++ basics
C++ basicsC++ basics
C++ basics
 
WP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a SilverlightWP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a Silverlight
 
Cbsecomputersciencecclass12boardproject bankmanagmentsystem-180703065625-conv...
Cbsecomputersciencecclass12boardproject bankmanagmentsystem-180703065625-conv...Cbsecomputersciencecclass12boardproject bankmanagmentsystem-180703065625-conv...
Cbsecomputersciencecclass12boardproject bankmanagmentsystem-180703065625-conv...
 
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docxCSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
CSC139 Chapter 9 Lab Assignments (1) Classes and Obj.docx
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)
 
Cbse computer science (c++) class 12 board project bank managment system
Cbse computer science (c++)  class 12 board project  bank managment systemCbse computer science (c++)  class 12 board project  bank managment system
Cbse computer science (c++) class 12 board project bank managment system
 
c++basics.ppt
c++basics.pptc++basics.ppt
c++basics.ppt
 
C++basics
C++basicsC++basics
C++basics
 
C++basics
C++basicsC++basics
C++basics
 
c++basiccs.ppt
c++basiccs.pptc++basiccs.ppt
c++basiccs.ppt
 
c++basics.ppt
c++basics.pptc++basics.ppt
c++basics.ppt
 
c++basics.ppt
c++basics.pptc++basics.ppt
c++basics.ppt
 
Please distinguish between the .h and .cpp file, create a fully work.pdf
Please distinguish between the .h and .cpp file, create a fully work.pdfPlease distinguish between the .h and .cpp file, create a fully work.pdf
Please distinguish between the .h and .cpp file, create a fully work.pdf
 
The Technical Debt of Programming Languages
The Technical Debt of Programming LanguagesThe Technical Debt of Programming Languages
The Technical Debt of Programming Languages
 
Avoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tireAvoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tire
 

Mais 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
 
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
 
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
 
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
 
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
 
Programming in UML: An Introduction to fUML 1.3 and Alf 1.1
Programming in UML: An Introduction to fUML 1.3 and Alf 1.1Programming in UML: An Introduction to fUML 1.3 and Alf 1.1
Programming in UML: An Introduction to fUML 1.3 and Alf 1.1Ed Seidewitz
 
UML: This Time We Mean It!
UML: This Time We Mean It!UML: This Time We Mean It!
UML: This Time We Mean It!Ed Seidewitz
 
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
 
UML: Once More with Meaning
UML: Once More with MeaningUML: Once More with Meaning
UML: Once More with MeaningEd Seidewitz
 
Succeeding with Agile in the Federal Government: A Coach's Perspective
Succeeding with Agile in the Federal Government: A Coach's PerspectiveSucceeding with Agile in the Federal Government: A Coach's Perspective
Succeeding with Agile in the Federal Government: A Coach's PerspectiveEd Seidewitz
 
UML 2.5: Specification Simplification
UML 2.5: Specification SimplificationUML 2.5: Specification Simplification
UML 2.5: Specification SimplificationEd Seidewitz
 
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
 
Architecting Your Enterprise
Architecting Your EnterpriseArchitecting Your Enterprise
Architecting Your EnterpriseEd Seidewitz
 
Executable UML and SysML Workshop
Executable UML and SysML WorkshopExecutable UML and SysML Workshop
Executable UML and SysML WorkshopEd Seidewitz
 

Mais de Ed Seidewitz (20)

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?
 
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
 
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
 
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
 
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
 
Programming in UML: An Introduction to fUML 1.3 and Alf 1.1
Programming in UML: An Introduction to fUML 1.3 and Alf 1.1Programming in UML: An Introduction to fUML 1.3 and Alf 1.1
Programming in UML: An Introduction to fUML 1.3 and Alf 1.1
 
UML: This Time We Mean It!
UML: This Time We Mean It!UML: This Time We Mean It!
UML: This Time We Mean It!
 
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
 
UML: Once More with Meaning
UML: Once More with MeaningUML: Once More with Meaning
UML: Once More with Meaning
 
Succeeding with Agile in the Federal Government: A Coach's Perspective
Succeeding with Agile in the Federal Government: A Coach's PerspectiveSucceeding with Agile in the Federal Government: A Coach's Perspective
Succeeding with Agile in the Federal Government: A Coach's Perspective
 
UML 2.5: Specification Simplification
UML 2.5: Specification SimplificationUML 2.5: Specification Simplification
UML 2.5: Specification Simplification
 
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
 
Architecting Your Enterprise
Architecting Your EnterpriseArchitecting Your Enterprise
Architecting Your Enterprise
 
Executable UML and SysML Workshop
Executable UML and SysML WorkshopExecutable UML and SysML Workshop
Executable UML and SysML Workshop
 

Último

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 

Último (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 

A Unified View of Modeling and Programming

  • 1. A Unified View of Modeling and Programming: The Perspective from Executable UML Presented at ISoLA 2016, Corfu, Greece Ed Seidewitz 10 October 2016 Copyright © 2016 Ed Seidewitz
  • 2. We can model that!We can model that! What is a model? A model is a set of statements in a modeling language about some system under study or domain.* What is a program? A program is a specification for a computation to be a executed on a computer. Models and Programs * See Ed Seidewitz, “What Models Mean”, IEEE Software, September/October 2003 for more.
  • 3. We can model that!We can model that! A program is a model of the specified computation, abstracting away from the details of how the computation is actually executed on a computer. A programming language is a modeling language for creating models of execution. All programs are models Customer customer = customers.get(customerId); if (customer != null) { int totalBalance = 0; for (Account account: customer.accounts) { totalBalance += account.balance; } } Customer customer = customers.get(customerId); if (customer != null) { int totalBalance = 0; for (Account account: customer.accounts) { totalBalance += account.balance; } } Java …and a value called “totalBalance”… …and a value called “totalBalance”… … that is iteratively computed to be the sum of the customer’s account balances. … that is iteratively computed to be the sum of the customer’s account balances. There is a customer identified by “customerId”… There is a customer identified by “customerId”…
  • 4. We can model that! Programs can also be domain models public class Bank { private String bankId; private Set<Customer> customers; private Set<Account> accounts; ... } public class Bank { private String bankId; private Set<Customer> customers; private Set<Account> accounts; ... } public class Customer { private String customerId; private Set<Account> accounts; ... } public class Customer { private String customerId; private Set<Account> accounts; ... } public class Account { private String accountId; private int balance = 0; private Set<Customer> accountOwners; ... } public class Account { private String accountId; private int balance = 0; private Set<Customer> accountOwners; ... } Classes are intended to reflect domain concepts. Classes are intended to reflect domain concepts. Fields reflect properties of those concepts… Fields reflect properties of those concepts… … or relationships with other concepts. … or relationships with other concepts.
  • 5. We can model that! But make implementation commitments public class Customer { ... private Set<Account> accounts = new HashSet<Account>(); public void addAccount(Account account) { if (account != null && !this.accounts.contains(account)) { this.accounts.add(account); account.addAccountOwner(this); } } ... } public class Customer { ... private Set<Account> accounts = new HashSet<Account>(); public void addAccount(Account account) { if (account != null && !this.accounts.contains(account)) { this.accounts.add(account); account.addAccountOwner(this); } } ... } public class Bank { ... private Map<String, Account> customers = new HashMap<String, Customer>(); public Integer totalAccountBalance(String customerId) { Integer totalBalance = null; Customer customer = this.customers.get(customerId); if (customer != null) { totalBalance = 0; for (Account account: customer.accounts) { totalBalance += account.balance; } } return totalBalance; } ... } public class Bank { ... private Map<String, Account> customers = new HashMap<String, Customer>(); public Integer totalAccountBalance(String customerId) { Integer totalBalance = null; Customer customer = this.customers.get(customerId); if (customer != null) { totalBalance = 0; for (Account account: customer.accounts) { totalBalance += account.balance; } } return totalBalance; } ... } Pick implementation classes for collections. Pick implementation classes for collections. Deal with bidirectional relationships. Deal with bidirectional relationships. Choose representations for efficient computation. Choose representations for efficient computation. Decide on (generally sequential) control structuring. Decide on (generally sequential) control structuring.
  • 6. We can model that!We can model that! UML began as a notation for models of programs. But UML 2 has constructs that allow the specification of Turing- complete computation models. •Foundational UML (fUML) provides precise execution semantics. •Action Language for fUML (Alf) provides a textual notation. Executable UML models are programs customer = Customer -> select c (c.customerId == customerId); totalBalance = customer.accounts.balance -> reduce '+'; customer = Customer -> select c (c.customerId == customerId); totalBalance = customer.accounts.balance -> reduce '+'; Alf … and a value called “totalBalance” that is sum of the customer’s account balances. … and a value called “totalBalance” that is sum of the customer’s account balances. There is a customer identified by “customerId”… There is a customer identified by “customerId”…
  • 7. We can model that! UML is common for domain modeling public class Bank { private String bankId; private Set<Customer> customers; private Set<Account> accounts; ... } public class Bank { private String bankId; private Set<Customer> customers; private Set<Account> accounts; ... } public class Customer { private String customerId; private Set<Account> accounts; ... } public class Customer { private String customerId; private Set<Account> accounts; ... } public class Account { private String accountId; private int balance = 0; private Set<Customer> accountOwners; ... } public class Account { private String accountId; private int balance = 0; private Set<Customer> accountOwners; ... } The UML model directly corresponds to the program design… The UML model directly corresponds to the program design… …but abstracts away from implementation details (like collection classes). …but abstracts away from implementation details (like collection classes). It also shows some things implicit in the program, like association composition and bidirectionality. It also shows some things implicit in the program, like association composition and bidirectionality.
  • 8. We can model that! But diagrams are just notation class Bank { public bankId: String; public customers: compose Customer[*]; public accounts: compose Account[*]; } class Bank { public bankId: String; public customers: compose Customer[*]; public accounts: compose Account[*]; } assoc AccountOwnership { public accountOwners: Customer[*]; public accounts: Account[*]; } assoc AccountOwnership { public accountOwners: Customer[*]; public accounts: Account[*]; } class Account { public accountId: String; public balance: Integer = 0; } class Account { public accountId: String; public balance: Integer = 0; } class Customer { public customerId: String; } class Customer { public customerId: String; } A UML class model has semantics independent of its mapping to any other language… A UML class model has semantics independent of its mapping to any other language… …which can be notated textually as well as graphically. …which can be notated textually as well as graphically.
  • 9. We can model that! Computation can be modeled, too class Bank { public bankId: String; public customers: compose Customer[*]; public accounts: compose Account[*]; public totalAccountBalance(in customerId: String): Integer[0..1] { customer = this.customers -> select c (c.customerId == customerId); return customer.accounts.balance -> reduce '+'; } ... } class Bank { public bankId: String; public customers: compose Customer[*]; public accounts: compose Account[*]; public totalAccountBalance(in customerId: String): Integer[0..1] { customer = this.customers -> select c (c.customerId == customerId); return customer.accounts.balance -> reduce '+'; } ... } The underlying semantics are based on data-flow, not an implicit von Neumann architecture. The underlying semantics are based on data-flow, not an implicit von Neumann architecture. These actions are inherently concurrent. These actions are inherently concurrent. …with far fewer implementation commitments. …with far fewer implementation commitments.
  • 10. We can model that! And declarative constraints, too A UML constraint can be specified using a UML behavior. A UML constraint can be specified using a UML behavior.
  • 11. We can model that! Allowing deductions to be made Given the accounts of a customer, the totalBalance can be derived. Given the accounts of a customer, the totalBalance can be derived. Given the accountOwners of an account, the owning bank can be deduced (or validated). Given the accountOwners of an account, the owning bank can be deduced (or validated).
  • 12. We can model that!We can model that! A combined modeling/programming language should: •Be designed to express both problem and solution domain models, not just abstract hardware computing paradigms •Have formal semantics that allow reasoning about models, with execution semantics for behavioral models •Have a textual notation for representing and reasoning on all types of models, with graphical notations allowing multiple views of the same model Combining modeling and programming
  • 13. We can model that!We can model that! • Models can be given precise semantics. • Not all model semantics are execution semantics. – E.g., requirements models, architectural models, business models… • Some models have execution semantics, and these are programs. • Executable models in context of wider modeling allows deductive or inductive reasoning combined with execution and testing Why is this a good idea?