![Page 1: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/1.jpg)
An Executable UML Virtual Machine
Marc J. Balcer
![Page 2: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/2.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 2
Contents
Concept
Architecture- Static Model Import
- Single Program
- State Machines
- Connecting to the World
Outcomes
Epilogue
![Page 3: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/3.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 3
Project Origins
what to do about an action
language?
we need to make sure it’s
compliant
I want a scripted model verifier
We have these new UML
Action Semantics
Executable UML is more than code
generation
![Page 4: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/4.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 4
Executable UML != Code Generation
Executable Models
Archetypes and MappingsModel Compiler
Software SystemGenerator
Execution Engine
Libraries, Legacy,and Hand-Written
Code
politically incorrect cartoon
![Page 5: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/5.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 5
Executable UML != Code Generation
Executable Models
Archetypes and Mappings
Software SystemModel
Machine
Libraries, Legacy,and Hand-Written
Code
![Page 6: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/6.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 6
Scripted Model Verifier
Executable Models
ModelMachine
• Test-first development with models
• Simple single-processor architecture
![Page 7: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/7.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 7
UML Action Semantics
Integrated into UML 1.5
Fundamental actions on UML elements (classes, associations, …)
Foundations for writing processing in an executable model- in the problem domain
- does not presume an implementation
Precise Action Semantics for UML
Precise Action Semantics for UML
![Page 8: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/8.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 8
Action Language & Semantics
This action language
create object p of Publisher;p.name := "Addison-Wesley";create object b of Book;relate p to b across R1;b.title := "Analysis Patterns";b.copyright := 1997;
create object b of Book;b.title := "Refactoring";b.subtitle := "Improving the Design …";b.copyright := 2001;
![Page 9: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/9.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 9
Action Language & Semantics
Or this action language compiles to actions
p := new Publisher {.name := "Addison-Wesley";-> Book := new Book {
.title := "Analysis Patterns";
.copyright := 1997;};-> Book := new Book {
.title := "Refactoring";
.subtitle := "Improving the Design …";
.copyright := 2001;}
}
createObject “Publisher”addVariableValue "p"groupAction {
readContextliteralValue "Addison-Wesley" addAttributeValue “name"readContextcreateObject "Book"createLink "Book"groupAction {
readContextliteralValue “Analysis Patterns" addAttributeValue “title"readContextliteralValue "1997"setAttributeValue “copyright"
} . . .
This looks like a (virtual) machine
language…
![Page 10: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/10.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 10
Aside: Why a Virtual Machine?
Java made VMspalatable
Project can focus on models & mappings
Easier to debug models at the model level An executable UML
virtual machine is critical to completing the idea of UML as a
computing formalism
![Page 11: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/11.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 11
Contents
Concept
Architecture- Static Model Import
- Single Program
- State Machines
- Connecting to the World
Outcomes
Epilogue
![Page 12: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/12.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 12
Static Model Import
extractor(for
modelingtool)
modelmachine
<domain name="Bookstore"><type name="String"/><type name="ISBNPublisherCode"/><type name="MailingAddress"/><type name="Year"/><type name="Money"/><class name="Publisher">
<attribute name="name" type="String"/><attribute name="code" type="ISBNPublisherCode"/><attribute name="address" type="MailingAddress"/>
</class><class name="Book">
<attribute name="title" type="String"/><attribute name="subtitle" type="String"/><attribute name="copyright" type="Year"/><attribute name="unitPrice" type="Money"/>
</class><association name="R1">
<associationEnd phrase="produces and markets" multiplicity="0..*" class="Book"/><associationEnd phrase="is produced and marketed by" multiplicity="1" class="Publisher"/>
</association></domain>
model (as XML)
Load
Publishername : Stringcode : ISBNPublisherCodeaddress : MailingAddress
Booktitle : Stringsubtitle : Stringcopyright : YearunitPrice : Money
0..*
1is produced and marketed by
1
R1
produces and markets 0..*
model (as diagrams
in tool’s repository)
MDA “PIM”
![Page 13: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/13.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 13
Aside: Why Not XMI?
XMI is
Too much- Only want what’s in the
executable profile
- Models, not diagrams
Not enough- No XMI for actions
<domain name="Bookstore"><type name="String"/><type name="ISBNPublisherCode"/><type name="MailingAddress"/><type name="Year"/><type name="Money"/><class name="Publisher">
<attribute name="name" type="String"/><attribute name="code" type="ISBNPublisherCode"/><attribute name="address" type="MailingAddress"/>
</class><class name="Book">
<attribute name="title" type="String"/><attribute name="subtitle" type="String"/><attribute name="copyright" type="Year"/><attribute name="unitPrice" type="Money"/>
</class><association name="R1">
<associationEnd phrase="produces and markets"multiplicity="0..*" class="Book"/>
<associationEnd phrase="is produced and marketed by"multiplicity="1" class="Publisher"/>
</association></domain>
BesidesXMI MXML
is just a mapping problem!
This is human-
readable
![Page 14: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/14.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 14
model machine
Internal Representations
Everything needed to load and run a model
Of course, this is not the only way- there can be multiple
VMs
- a single VM may support multiple approaches
relational DB(for object
persistence)
task task task task
per state machine instance
XMLDOM
interface
![Page 15: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/15.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 15
Mappings
Design-time assignment of different realizations to distinct elements in the model
Separate from the model and the machine
“Uniformity != Rigidity”
![Page 16: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/16.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 16
Mappings
Some things are not in the model
- Model just declares a type
- How should the machine realize it?
A mapping directs the VM how to realize something in the model
- Not part of the application model
- May be changed separately from the model
<class name="Publisher"><attribute name="name"
type="String"/><attribute name="code"
type="ISBNPublisherCode"/><attribute name="address"
type="MailingAddress"/></class>
<type name="MailingAddress"><field name="street"
type="String" length="100"/><field name="city"
type="String" length="50"/><field name="state"
type="String" length="2"/>. . .
type mapping
model
![Page 17: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/17.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 17
Loading a Model
extractor(for
modelingtool)
modelmachine
<class name="Publisher"><attribute name="name"
type="String"/><attribute name="code"
type="ISBNPublisherCode"/><attribute name="address"
type="MailingAddress"/></class>
<type name="MailingAddress"><field name="street"
type="String" length="100"/><field name="city"
type="String" length="50"/><field name="state"
type="String" length="2"/>. . .mapping
model
MappingMaker
![Page 18: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/18.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 18
Using the Loaded Model
Got a model loaded
Now what to do?- load objects
- operate on them
- run the state machines
- connect the model to the rest of the world
modelmachine
<class name="Publisher"><attribute name="name"
type="String"/><attribute name="code"
type="ISBNPublisherCode"/><attribute name="address"
type="MailingAddress"/></class>
<type name="MailingAddress"><field name="street"
type="String" length="100"/><field name="city"
type="String" length="50"/><field name="state"
type="String" length="2"/>. . .mapping
model
![Page 19: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/19.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 19
Single Program
actionlanguagecompiler
modelmachine
<program source="codePath"><createObject>
<createClass name="Publisher"/></createObject><duplicate/><addVariableValue name="p"/><groupAction>
<readContext/><literalValue value="Addison-Wesley" type="string"/><setAttributeValue name="name"/><readContext/><createObject>
<createClass name="Book"/></createObject><duplicate/><createLink class="Book"/><groupAction>
<readContext/><literalValue value="Analysis Patterns" type="string"/><setAttributeValue name="title"/><readContext/><literalValue value="1997" type="integer"/><setAttributeValue name="copyright"/>
</groupAction> . . .
program XML
Run
p := new Publisher {.name := "Addison-Wesley";-> Book := new Book {
.title := "Analysis Patterns";
.copyright := 1997;};-> Book := new Book {
.title := "Refactoring";
.subtitle := "Improving the Design …";
.copyright := 2001;}
}
![Page 20: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/20.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 20
Programs
Executed for- external activity
- state procedures
- derived attributes
- constraint checks
Written in fundamental actions
<program source="codePath"><createObject>
<createClass name="Publisher"/></createObject><duplicate/><addVariableValue name="p"/><groupAction>
<readContext/><literalValue value="Addison-Wesley" type="string"/><setAttributeValue name="name"/><readContext/><createObject>
<createClass name="Book"/></createObject><duplicate/><createLink class="Book"/><groupAction>
<readContext/><literalValue value="Analysis Patterns" type="string"/><setAttributeValue name="title"/><readContext/><literalValue value="1997" type="integer"/><setAttributeValue name="copyright"/>
</groupAction> . . .
![Page 21: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/21.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 21
Single Program
p := new Publisher {.name := "Addison-Wesley";-> Book := new Book {
.title := "Analysis Patterns";
.copyright := 1997;};-> Book := new Book {
.title := "Refactoring";
.subtitle := "Improving the Design …";
.copyright := 2001;}
}
<program source="codePath"><createObject>
<createClass name="Publisher"/></createObject><duplicate/><addVariableValue name="p"/><groupAction>
<readContext/><literalValue value="Addison-Wesley" type="string"/><setAttributeValue name="name"/><readContext/><createObject>
<createClass name="Book"/></createObject><duplicate/><createLink class="Book"/><groupAction>
<readContext/><literalValue value="Analysis Patterns" type="string"/><setAttributeValue name="title"/><readContext/><literalValue value="1997" type="integer"/><setAttributeValue name="copyright"/>
</groupAction> . . .
![Page 22: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/22.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 22
Execution Context
Stack
Local Variables (named data flows)
Program (as actions)
![Page 23: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/23.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 23
State Machines
Each object has its own independently-executing state machine
State machines respond to events sent by actions
State machines are themechanism for concurrency
Can visualize with sequence diagrams
Statement Prepared
prepareStatement( statementDate )
Paid On Time
applyPayment( transaction )
Payment Past Due
dueDateReached
No Payment Due
noPaymentDue
Paid Late
applyPayment( transaction )
![Page 24: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/24.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 24
Time & Event Rules
![Page 25: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/25.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 25
Concurrency
Each object has its own execution context
Statement Prepared
prepareStatement( statementDate )
Paid On Time
applyPayment( transaction )
Payment Past Due
dueDateReached
No Payment Due
noPaymentDue
Paid Late
applyPayment( transaction )
Statement Prepared
prepareStatement( statementDate )
Paid On Time
applyPayment( transaction )
Payment Past Due
dueDateReached
No Payment Due
noPaymentDue
Paid Late
applyPayment( transaction )
Statement Prepared
prepareStatement( statementDate )
Paid On Time
applyPayment( transaction )
Payment Past Due
dueDateReached
No Payment Due
noPaymentDue
Paid Late
applyPayment( transaction )
![Page 26: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/26.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 26
Distribution
Execution contexts may be consolidated or distributed- by class
Inventory Things:Publisher
BookAuthorship
Order Things:Customer
OrderCharge
![Page 27: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/27.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 27
Distribution
Execution contexts may be consolidated or distributed- by class
- by instance
Inventory Things:Publisher
BookAuthorship
Asia Order Things:Customer
OrderCharge
USA Order Things:Customer
OrderCharge
![Page 28: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/28.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 28
Distribution
Execution contexts may be consolidated or distributed- by class
- by instance
- by state
Inventory Things:Publisher
BookAuthorship
Order Things:Customer
Order (states 1-4)Charge
USA Shipment Things:ShippingClerk
Order (states 5-7)Shipment
Asia Shipment Things:ShippingClerk
Order (states 5-7)Shipment
![Page 29: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/29.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 29
Distribution
Communication between machines handled by XML messaging
Inventory Things:Publisher
BookAuthorship
Order Things:Customer
Order (states 1-4)Charge
USA Shipment Things:ShippingClerk
Order (states 5-7)Shipment
Asia Shipment Things:ShippingClerk
Order (states 5-7)Shipment
The async nature of Exectuable UML signals comes in
handy here.
![Page 30: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/30.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 30
Connecting to the World
Load Model
Run Program
“Peek/Poke”
Notification
Non-storedattribute access
Explicit Implicit
ExternalapplyFunction
![Page 31: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/31.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 31
Example Applications
Scripted Model Verifier- Windows application
- Use notifications to show changes in real-time
![Page 32: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/32.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 32
Example Applications
Web Application Engine- COM component
- Callable from within an ASP program
- No use of notifications
- Form postings compiled to inbound programs
![Page 33: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/33.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 33
Contents
Concept
Architecture- Static Model Import
- Single Program
- State Machines
- Connecting to the World
Outcomes
Epilogue
![Page 34: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/34.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 34
Outcomes
TALL action language
Metamodel
XML for Executable UML
Virtual Machine Zero
Development Tools
![Page 35: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/35.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 35
TALL action language
Functional
True to action semantics
Traditional-looking syntax
p := new Publisher {.name := "Addison-Wesley";-> Book := new Book {
.title := "Analysis Patterns";
.copyright := 1997;};-> Book := new Book {
.title := "Refactoring";
.subtitle := "Improving the Design …";
.copyright := 2001;}
}
foreach readyOrder in Order[.approved = true] {^readyOrder.packAndShip();
}
![Page 36: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/36.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 36
Metamodel
Fundamental for translation
Foundation for tools and interchange formats
is of type
R102
definestype of
1*
is acharacteristicof
R103
characteristics areabstracted as
1
*
{disjoint, complete}R104
computesvalue of
R105
value iscomputedby
1 1
participatesin
R110
relates
*
1..*
subclasses are
R115
is a specialization of
1..*
*
{disjoint,complete}
R118
superclassmust be
R119
issubclassedaccordingto
1 1..*
return type is
R120 = R105+R104+R102
defines return type of
1
*
issynchronouslymodified by
R122
synchronouslymodifies
* 1
instances are subject to
R123
restricts values of
*
1
instances are subject to
R124
restricts values of
*
1
belongsto
R111
defines
1
*
belongs to
R121
defines
1
*
formalizes
R109 isformalizedby
1
0,1
is
R125
is
0,1 1
<<Imported>>Domain
{1,Domain}
name : string {I}description : DescriptionString
Class{101,Class}
classNumber : integer {I}name : string {I2}abbreviation : string {I3}description : DescriptionString
Attribute{102,Attribute}
name : stringdescription : DescriptionString
<<Imported>>Datatype
{2,Datatype}
name : string {I}description : DescriptionString
BaseAttribute{103,BaseAttribute}
DerivedAttribute{104,DerivedAttribute}
AttributeFormula{105,AttributeFormula}
Generalization{106,Generalization}
discriminator : string {I}isComplete : boolean
Specialization{107,Specialization}
Association{108,Association}
associationNumber : integer {I}name : string {I2}description : DescriptionString
AssociationEnd{109,AssociationEnd}
associationNumber : integer {I,I2,R110}classNumber : integer {I,R110}phrase : string {I2}multiplicity : integer
AbstractClass{112,AbstractClass}
classNumber : integer{I,R118}
ConcreteClass{113,ConcreteClass}
classNumber : integer{I,R118}
Transformer{114,Transformer}
name : string
<<Imported>>ClassConstraint
{307,ClassConstraint}
<<Imported>>AssociationConstraint
{308,AssociationConst}
AssociationClass{115,AssociationClass}
![Page 37: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/37.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 37
XML for Executable UML
Just Enough- Only want what’s in the
executable profile
- Models, not diagrams
- Includes actions
<domain name="Bookstore"><type name="String"/><type name="ISBNPublisherCode"/><type name="MailingAddress"/><type name="Year"/><type name="Money"/><class name="Publisher">
<attribute name="name" type="String"/><attribute name="code" type="ISBNPublisherCode"/><attribute name="address" type="MailingAddress"/>
</class><class name="Book">
<attribute name="title" type="String"/><attribute name="subtitle" type="String"/><attribute name="copyright" type="Year"/><attribute name="unitPrice" type="Money"/>
</class><association name="R1">
<associationEnd phrase="produces and markets"multiplicity="0..*" class="Book"/>
<associationEnd phrase="is produced and marketed by"multiplicity="1" class="Publisher"/>
</association></domain>
![Page 38: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/38.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 38
Virtual Machine One
Single Processor
Windows
MS Access / Jet persistence
Only because it’s cheap & ubiquitous
![Page 39: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/39.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 39
Development Tools
Extractors- Rose
- BridgePoint
Generator- based upon domain chart
Model Verifier- based upon VM-zero
Is this starting to become a commercial message?
![Page 40: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/40.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 40
Contents
Concept
Architecture- Static Model Import
- Single Program
- State Machines
- Connecting to the World
Outcomes
Epilogue
![Page 41: An Executable UML Virtual Machine - OMG · Aside: Why a Virtual Machine? Java made VMs palatable Project can focus on ... - run the state machines - connect the model to the rest](https://reader036.vdocuments.mx/reader036/viewer/2022081323/5b0657957f8b9ad1768cafcd/html5/thumbnails/41.jpg)
Copyright 2002, 2003 Marc J. Balcer. All Rights Reserved 41
Epilogue
Building the VM helped to- check the action semantics
- build an Executable UML metamodel
- start a new business in this economy!