SlideShare a Scribd company logo
Models, Programs and Executable UML Presented at the First International Workshop on  Combined Object-Oriented Modeling and Programming Ed Seidewitz
Models and Programs 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. * See Ed Seidewitz, “What Models Mean”,  IEEE Software,  September/October 2003 for more.
Contentions All programs are models. Executable UML models are programs. Executable UML models are useful.
1. All programs are models 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. Customer customer = customers.get(customerId); if  (customer !=  null ) { int  totalBalance = 0; for  (Account account: customer.accounts) { totalBalance += account.balance; } } … and a value called “totalBalance”… …  that is iteratively computed to be the sum of the customer’s account balances. There is a customer identified by “customerId”… Java
OO programs are also domain models 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  Account { private  String accountId; private   int  balance = 0; private  Set<Customer> accountOwners; ... } Classes are intended to reflect domain concepts. Fields reflect properties of those concepts… …  or relationships with other concepts.
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  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. Deal with bidirectional relationships. Choose representations for efficient computation. Decide on (generally sequential) control structuring.
2. Executable UML models are programs 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. customer = Customer ->  select  c (c.customerId == customerId); totalBalance = customer.accounts.balance ->  reduce  '+'; …  and a value called “totalBalance” that is sum of the customer’s account balances. There is a customer identified by “customerId”… Alf
UML is common for domain modeling 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  Account { private  String accountId; private   int  balance = 0; private  Set<Customer> accountOwners; ... } The UML model directly corresponds to the program design… … but abstracts away from implementation details (like collection classes). It also shows some things implicit in the program, like association composition and bidirectionality.
But diagrams are just notation class  Bank { public  bankId: String; public  customers:  compose  Customer[*]; public  accounts:  compose  Account[*]; } assoc  AccountOwnership { public  accountOwners: Customer[*]; public  accounts: Account[*]; } class  Account { public  accountId: String; public  balance: Integer = 0; } class  Customer { public  customerId: String; } A UML class model has semantics independent of its mapping to any other language… … which can be notated textually as well as graphically. UML isn’t  “just pictures”!
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  '+'; } ... } The underlying semantics are based on data-flow, not an implicit von Neumann architecture. These actions are inherently concurrent. … with far fewer implementation commitments.
3. Executable UML models are useful Executable UML models… … can be tested,  because they are programs … don’t need to be “recoded”,  they can be “compiled” … abstract computation,  not machine architecture
Programming in UML is just programming … with models provisioned by a platform-specific “model compiler”. But at a higher level of abstraction… Past executable modeling approaches have demonstrated this can be done for with production quality. The models are validated in a development/test environment The models are deployed in a production environment Developers create fully executable models Developers iteratively execute, test and update the models
Resources Foundational UML (fUML) Specification http://www.omg.org/spec/FUML   Reference Implementation Project  http://www.modeldriven.org/fuml Action Language for fUML (Alf) Specification  http://www.omg.org/spec/ALF   Reference implementation repository  http://lib.modeldriven.org/MDLibrary/trunk/Applications/Alf-Reference-Implementation   /doc – Latest specification document (currently v1.0 Beta) /dist – Parser for latest language version Alf implementation in Eclipse Papyrus UML tool https://bugs.eclipse.org/bugs/show_bug.cgi?id=329865   Contact:  [email_address] ,  http://twitter.com/seidewitz

More Related Content

PPTX
Standards-Based Executable UML: Today's Reality and Tomorrow's Promise
PPT
A Unified View of Modeling and Programming
PPTX
Hands On With the Alf Action Language: Making Executable Modeling Even Easier
PPTX
UML as a Programming Language
PPTX
Using Alf with Cameo Simulation Toolkit - Part 1: Basics
PPTX
Leveraging Alf for SysML, Part 1: Better Simulation Modeling
PPTX
Using Alf with Cameo Simulation Toolkit - Part 2: Modeling
PPTX
Leveraging Alf for SysML, Part 2: More Effective Trade Study Modeling
Standards-Based Executable UML: Today's Reality and Tomorrow's Promise
A Unified View of Modeling and Programming
Hands On With the Alf Action Language: Making Executable Modeling Even Easier
UML as a Programming Language
Using Alf with Cameo Simulation Toolkit - Part 1: Basics
Leveraging Alf for SysML, Part 1: Better Simulation Modeling
Using Alf with Cameo Simulation Toolkit - Part 2: Modeling
Leveraging Alf for SysML, Part 2: More Effective Trade Study Modeling

What's hot (20)

PPTX
Chapter3: fundamental programming
PPTX
Introduction to the OMG Systems Modeling Language (SysML), Version 2
PPT
C and C++ Industrial Training Jalandhar
PPTX
Precise Semantics Standards at OMG: Executing on the Vision
PDF
AspectC++: Language Proposal and Prototype Implementation
PDF
Terminal Widgets
PDF
Top C Language Interview Questions and Answer
DOCX
C Programming
PDF
Object-Oriented Programming in Modern C++. Borislav Stanimirov. CoreHard Spri...
PDF
Day2 Intro. Model Sim
PDF
Itsjustangular
PPT
Introduction to Procedural Programming in C++
PPT
Basics of c++
PPT
On Scala Slides - OSDC 2009
PPTX
C programming
PPT
Class7
PDF
C programming
ODP
Aspect-Oriented Technologies
DOC
Project two c++ tutorial
PPT
OOP in C++
Chapter3: fundamental programming
Introduction to the OMG Systems Modeling Language (SysML), Version 2
C and C++ Industrial Training Jalandhar
Precise Semantics Standards at OMG: Executing on the Vision
AspectC++: Language Proposal and Prototype Implementation
Terminal Widgets
Top C Language Interview Questions and Answer
C Programming
Object-Oriented Programming in Modern C++. Borislav Stanimirov. CoreHard Spri...
Day2 Intro. Model Sim
Itsjustangular
Introduction to Procedural Programming in C++
Basics of c++
On Scala Slides - OSDC 2009
C programming
Class7
C programming
Aspect-Oriented Technologies
Project two c++ tutorial
OOP in C++
Ad

Similar to Models, Programs and Executable UML (20)

PPT
Introduction to C#
PPTX
WP7 HUB_Introducción a Silverlight
PDF
.NET Portfolio
PDF
PRELIM-Lesson-2.pdf
PPTX
Presentation on visual basic 6 (vb6)
PDF
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
PPTX
Introduction to OO, Java and Eclipse/WebSphere
PPTX
data structure & algorithm chapter1.pptx
PDF
Vb net1
PDF
Book management system
PPTX
Hello world! Intro to C++
PPT
Model Driven Architecture and eXecutable UML
DOCX
Cbsecomputersciencecclass12boardproject bankmanagmentsystem-180703065625-conv...
PPTX
KMK1093 CHAPTER 2.kkkpptx KMK1093 CHAPTER 2.kkkpptx
PPTX
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
PDF
Cbse computer science (c++) class 12 board project bank managment system
PPT
U19CS101 - PPS Unit 4 PPT (1).ppt
PPT
C++ basics
PPTX
object oriented programming part inheritance.pptx
Introduction to C#
WP7 HUB_Introducción a Silverlight
.NET Portfolio
PRELIM-Lesson-2.pdf
Presentation on visual basic 6 (vb6)
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
Introduction to OO, Java and Eclipse/WebSphere
data structure & algorithm chapter1.pptx
Vb net1
Book management system
Hello world! Intro to C++
Model Driven Architecture and eXecutable UML
Cbsecomputersciencecclass12boardproject bankmanagmentsystem-180703065625-conv...
KMK1093 CHAPTER 2.kkkpptx KMK1093 CHAPTER 2.kkkpptx
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Cbse computer science (c++) class 12 board project bank managment system
U19CS101 - PPS Unit 4 PPT (1).ppt
C++ basics
object oriented programming part inheritance.pptx
Ad

More from Ed Seidewitz (16)

PPTX
SysML v2 - What's the big deal, anyway?
PPTX
The Very Model of a Modern Metamodeler
PPTX
SysML v2 and the Next Generation of Modeling Languages
PPTX
SysML v2 and MBSE: The next ten years
PPTX
Model Driven Architecture without Automation
PPT
Programming in UML: An Introduction to fUML 1.3 and Alf 1.1
PPSX
UML: This Time We Mean It!
PPTX
Executable UML Roadmap (as of September 2014)
PPTX
Essence: A Common Ground for Flexible Methods
PPTX
UML: Once More with Meaning
PPSX
Succeeding with Agile in the Federal Government: A Coach's Perspective
PPTX
UML 2.5: Specification Simplification
PPSX
Programming in UML: An Introduction to fUML and Alf
PPT
Architecting Your Enterprise
PPT
Programming in UML: Why and How
PPT
Executable UML and SysML Workshop
SysML v2 - What's the big deal, anyway?
The Very Model of a Modern Metamodeler
SysML v2 and the Next Generation of Modeling Languages
SysML v2 and MBSE: The next ten years
Model Driven Architecture without Automation
Programming in UML: An Introduction to fUML 1.3 and Alf 1.1
UML: This Time We Mean It!
Executable UML Roadmap (as of September 2014)
Essence: A Common Ground for Flexible Methods
UML: Once More with Meaning
Succeeding with Agile in the Federal Government: A Coach's Perspective
UML 2.5: Specification Simplification
Programming in UML: An Introduction to fUML and Alf
Architecting Your Enterprise
Programming in UML: Why and How
Executable UML and SysML Workshop

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Big Data Technologies - Introduction.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Cloud computing and distributed systems.
PDF
Unlocking AI with Model Context Protocol (MCP)
PPT
Teaching material agriculture food technology
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation theory and applications.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Spectroscopy.pptx food analysis technology
Network Security Unit 5.pdf for BCA BBA.
Big Data Technologies - Introduction.pptx
sap open course for s4hana steps from ECC to s4
Encapsulation_ Review paper, used for researhc scholars
NewMind AI Weekly Chronicles - August'25-Week II
Review of recent advances in non-invasive hemoglobin estimation
Cloud computing and distributed systems.
Unlocking AI with Model Context Protocol (MCP)
Teaching material agriculture food technology
Spectral efficient network and resource selection model in 5G networks
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Machine learning based COVID-19 study performance prediction
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Chapter 3 Spatial Domain Image Processing.pdf
cuic standard and advanced reporting.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11

Models, Programs and Executable UML

  • 1. Models, Programs and Executable UML Presented at the First International Workshop on Combined Object-Oriented Modeling and Programming Ed Seidewitz
  • 2. Models and Programs 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. * See Ed Seidewitz, “What Models Mean”, IEEE Software, September/October 2003 for more.
  • 3. Contentions All programs are models. Executable UML models are programs. Executable UML models are useful.
  • 4. 1. All programs are models 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. Customer customer = customers.get(customerId); if (customer != null ) { int totalBalance = 0; for (Account account: customer.accounts) { totalBalance += account.balance; } } … and a value called “totalBalance”… … that is iteratively computed to be the sum of the customer’s account balances. There is a customer identified by “customerId”… Java
  • 5. OO programs are also domain models 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 Account { private String accountId; private int balance = 0; private Set<Customer> accountOwners; ... } Classes are intended to reflect domain concepts. Fields reflect properties of those concepts… … or relationships with other concepts.
  • 6. 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 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. Deal with bidirectional relationships. Choose representations for efficient computation. Decide on (generally sequential) control structuring.
  • 7. 2. Executable UML models are programs 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. customer = Customer -> select c (c.customerId == customerId); totalBalance = customer.accounts.balance -> reduce '+'; … and a value called “totalBalance” that is sum of the customer’s account balances. There is a customer identified by “customerId”… Alf
  • 8. UML is common for domain modeling 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 Account { private String accountId; private int balance = 0; private Set<Customer> accountOwners; ... } The UML model directly corresponds to the program design… … but abstracts away from implementation details (like collection classes). It also shows some things implicit in the program, like association composition and bidirectionality.
  • 9. But diagrams are just notation class Bank { public bankId: String; public customers: compose Customer[*]; public accounts: compose Account[*]; } assoc AccountOwnership { public accountOwners: Customer[*]; public accounts: Account[*]; } class Account { public accountId: String; public balance: Integer = 0; } class Customer { public customerId: String; } A UML class model has semantics independent of its mapping to any other language… … which can be notated textually as well as graphically. UML isn’t “just pictures”!
  • 10. 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 '+'; } ... } The underlying semantics are based on data-flow, not an implicit von Neumann architecture. These actions are inherently concurrent. … with far fewer implementation commitments.
  • 11. 3. Executable UML models are useful Executable UML models… … can be tested, because they are programs … don’t need to be “recoded”, they can be “compiled” … abstract computation, not machine architecture
  • 12. Programming in UML is just programming … with models provisioned by a platform-specific “model compiler”. But at a higher level of abstraction… Past executable modeling approaches have demonstrated this can be done for with production quality. The models are validated in a development/test environment The models are deployed in a production environment Developers create fully executable models Developers iteratively execute, test and update the models
  • 13. Resources Foundational UML (fUML) Specification http://www.omg.org/spec/FUML Reference Implementation Project http://www.modeldriven.org/fuml Action Language for fUML (Alf) Specification http://www.omg.org/spec/ALF Reference implementation repository http://lib.modeldriven.org/MDLibrary/trunk/Applications/Alf-Reference-Implementation /doc – Latest specification document (currently v1.0 Beta) /dist – Parser for latest language version Alf implementation in Eclipse Papyrus UML tool https://bugs.eclipse.org/bugs/show_bug.cgi?id=329865 Contact: [email_address] , http://twitter.com/seidewitz