behavior as composite structure - conradbock.org · 2 overview motivation composite structure...

33
Behavior as Composite Structure: (Onto)Logical Behavior Modeling Conrad Bock, U.S. National Institute of Standards and Technology Antoine Lonjon MEGA James Odell Odell & Associates

Upload: dangthien

Post on 08-Apr-2019

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Behavior as Composite Structure:(Onto)Logical Behavior Modeling

Conrad Bock,U.S. National Institute of Standards and Technology

Antoine LonjonMEGA

James OdellOdell & Associates

Page 2: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

2

Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Page 3: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

3

Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Page 4: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Problem UML has three behavior diagrams.

– Activity, state, interaction. Very little integration or reuse between

them.– Three underlying metamodels.– Three representations of temporal order.

Triples the effort of learning UML and building analysis tools for it.

4

Page 5: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Solution Treat behaviors as assemblies of

other behaviors.– Like objects are assemblies of other

objects. Assembly = UML internal structure

– Pieces represented by properties.– Put together by connectors.

Put all behavior diagrams on the same underlying behavior assembly model.

5

Page 6: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

stm TireTraction [State Diagram]

Gripping Slipping

LossOfTraction

RegainTraction

Behaviors as Composite Structure

6

sd ABS_ActivationSequence [Sequence Diagram]

detTrkLos()

modBrkFrc()

sendSignal()

modBrkFrc(traction_signal:boolean)

sendAck()

d1:TractionDetector

m1:BrakeModulator

act PreventLockup [Activity Diagram]

Activity

State Machine

Interaction

Property

Connector

Property

Connector

Property

Connector

Page 7: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

7

Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Page 8: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

9

Whole-Part Whole-part relationships can

modeled as associations.

ControllerCamera

SatelliteModel(M1)

ThingsBeingModeled(M0)

Whole-partcam ctrl

cam camctrlctrl

USSatellite:

Controller inUSSatellite:

Camera inUSSatellite:

Camera in RussianSat:

RussianSatellite:

Controller in RussianSat:

Page 9: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

10

Part-Part, Not Part-part relationships cannot be

represented by associations.

ControllerCamera

Satellite

Controlling camera in different satellite

Model(M1)

ThingsBeingModeled(M0)

Controls

:Controls

Attempt at part-part

cam ctrl

cam camctrlctrl

USSatellite:

Controller inUSSatellite:

Camera inUSSatellite:

Camera in RussianSat:

RussianSatellite:

Controller in RussianSat:

Page 10: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

UML Composite Structure

11

class Satellite

ctrl : Controller

cam : Camera

: Controls

Controlling camera in same satellite

Model(M1)

ThingsBeingModeled(M0)

:Controls :Controlscam camctrlctrl

USSatellite:

Controller inUSSatellite:

Camera inUSSatellite:

Camera in RussianSat:

RussianSatellite:

Controller in RussianSat:

Controls

ctrlController

camCamera

Property

Connector(part-part)

Page 11: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

12

Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Page 12: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

13

Behavior

Behavior model “things” happening over time.– With temporal relations (time constraints) between them.

Time

Shoot

FocusBehavior

Take Picture

TakePicture

ShootFocusModel(M1)

ThingsBeingModeled(M0)

Happens during

Happens before

Page 13: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

14

Behavior as Composite Structure

Composite structure relations are temporal:– Whole-part = happens during.– Part-part = happens before.

Time

Shoot

FocusBehavior

Take Picture

TakePicture

ShootFocusModel(M1)

ThingsBeingModeled(M0)

Whole-part

Part-part

Whole-part Part-part

Page 14: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Behavior as Composite Structure

15

class TakePicture

step1: Focus

step2 : Shoot

: HappensBefore

Focusing before shooting in same taking picture

Model(M1)

ThingsBeingModeled(M0)

:HappensBefore

:HappensBefore

step2 step2step1step1

TakingPic2:

FocusingDuringTP2:

ShootingDuringTP2:

ShootingDuringTP1:

TakingPic1:

FocusingDuringTP1:

HappensBefore

step1Focus

step2Shoot

Property(whole-part)

Connector(part-part)

Page 15: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

16

Generalizing Composite Structure

Constraints are inherited in UML– including temporal constraints.

Time

Focus

TakePicture

Shoot

TakeSpecialPicture

LogBehavior

Take Picture

MultiFocus

ShootFocus ShootMultiFocus Log

Model(M1)

ThingsBeingModeled(M0)

MultiFocusFocus

HappensDuring

HappensBefore

Page 16: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

17

Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Page 17: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Behaviors are Classes in UML

Things being modeled are executions (instances) of behavior.

18

Take Special Picture

Model(M1)

ThingsBeingModeled(M0)

Take Picture

TakingSPic13/15/09 2pmET :

TakingPic14/19/09 1amET :

TakingPic22/5/10 8pmET :

Page 18: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Behaviors are Classes in UML

Things being modeled are executions (instances) of behavior. 19

Take Special Picture

Model(M1)

Things BeingModeled (M0)

Take Picture

TakingSPic13/15/09 2pmET :

TakingPic14/19/09 1amET :

TakingPic22/5/10 8pmET :

Behavior

Metamodel(M2)

Class

Page 19: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

But No Properties & Connectors

No links between things being modeled.20

Model(M1)

Things BeingModeled (M0)

TakingPic14/19/09 1amET :

Behavior

Metamodel(M2)

Class

TakePicture

ShootFocus

Action

Element

ControlFlow

ShootingDuringTP1:

FocusingDuringTP1:

Focus

Shoot

Page 20: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

21

Whole-part for Behaviors

Steps:– Are properties ...– typed by behaviors at M1…– that have “suboccurrences” as values at M0.

type

step1

Metamodel(M2)

FocusModel(M1)

Focus3/15/09 10-11amET :

TakePicture3/15/09 10-12pmET :

step1

Things BeingModeled (M0)

Class

Behavior

Property

Step

ownedProperty

TakePicture

ownedStep

type

Page 21: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

22

Whole-part for Behaviors

Steps:– Are properties ...– typed by behaviors at M1…– specialized from happensDuring-1 in a standard M1 library…– that have “suboccurrences” as values at M0.

type

step1

Metamodel(M2)

FocusUser Model(M1)

Focus3/15/09 10-11amET :

TakePicture3/15/09 10-12pmET :

step1

Things BeingModeled (M0)

Class

Behavior

Property

Step

ownedProperty

ownedStep

type

BehaviorOccurrence

happensDuring-1

happensBefore

Specializations of M1 BehaviorOccurrenceare instances of M2 Behavior, and vice versa.

TakePicture

StandardModel Library

(M1)

Page 22: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

23

Part-part for Behaviors

Successions:– Are connectors …– typed by happensBefore from a standard M1 library …– resulting in links between suboccurrences at M0.

Metamodel(M2)

Model(M1)

TakePicture

step1 : Focus

Property

typeowned

Property

ThingsBeingModeled(M0)

Connector/role

Succession

type

/fromStep

/toStep

step2 : Shoot

ownedConnector

step1 Focus3/15/09 10-11amET :

TakePicture3/15/09 10-12pmET :

step2 Shoot3/15/0911-12pmET :

: HappensBefore

Association

Class

StepownedStep

type

happensBefore

Behavior

{redefines}

Page 23: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Automated M1 Patterns Such as

– Typing properties by behaviors and …– … subsetting them from happensDuring-1

– … linking them with connectors typed by HappensBefore.

Specified in a standard M2– In M2 Step and Succession …– … using OCL, etc.

Applied at M1 during M2 instantiation …– … automatically.– Modelers & API users don’t need to know.24

Page 24: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

25

Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Page 25: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

The “O” Word Has many meanings

– Can spend more time defining it than doing it.

Two meanings used here:– Start with the things being modeled

(real, desired, imagined, simulated, etc).– Group (classify) those things by their

commonalities.

26

Page 26: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

(Onto)Logical Modeling Start with the things being modeled (M0),

and works towards a language. – At OMG we normally start immediately with

language (metamodels, M2). Look for commonalities among the

things being modeled– Build model libraries (M1) capturing

commonalities of those (M0) things. When modeling becomes too repetitive,

capture M1 patterns in metamodels.27

Page 27: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Behavior: What’s Being Modeled?

“Things” that occur in time– Eg, taking a picture, focusing, etc.– Not “behaviors”, “actions”, etc.

28

Focus3/15/09 10-11amET :

TakePicture3/15/09 10-12pmET :

Things BeingModeled (M0)

Shoot3/15/0911-12pmET :

Page 28: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Behavior: What’s in Common?

They happen before or during each other.– Construct M1 library for this.– Use it to classify things being modeled. 29

Things BeingModeled (M0)

happensDuring-1 Focus

3/15/09 10-11amET :TakePicture

3/15/09 10-12pmET :

Shoot3/15/0911-12pmET :

happensBefore

BehaviorOccurrence

happensDuring-1

happensBefore

StandardModel Library

(M1)

happensDuring-1

Page 29: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Behavior: Use Library

Specialize library classes and subset/redefine library properties. 30

Things BeingModeled (M0)

step1 Focus3/15/09 10-11amET :

TakePicture3/15/09 10-12pmET :

Shoot3/15/0911-12pmET :

happensBefore

BehaviorOccurrence

happensDuring-1

happensBefore

StandardModel Library

(M1)

User Model(M1)

step2

TakePicture

step1 : Focus step2 : Shoot: HappensBefore

Page 30: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Behavior: Too repetitive?

Capture M1 patterns in M2 elements.– Tools apply patterns automatically.

31

Property

typeowned

PropertyConnector

/role

type

/fromStep

/toStep

ownedConnector

Association

Class

StepownedStep

Behavior

{redefines}

Metamodel(M2)

Things BeingModeled (M0)

step1 Focus3/15/09 10-11amET :

TakePicture3/15/09 10-12pmET :

Shoot3/15/0911-12pmET :

happensBefore

User Model(M1)

step2

TakePicture

step2 : Shoot: HappensBefore

Succession

step1 : Focus

Page 31: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

32

Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Page 32: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

Summary Unify UML’s three behavior models with

– Composite structure.– Model library for temporal relations.– Metamodel elements capturing patterns of

using library, applied automatically. Simplifies metamodel with

– More common behavior elements, fewer specializations.

– Standard model library. Speeds learning and analysis integration.

33

Page 33: Behavior as Composite Structure - conradbock.org · 2 Overview Motivation Composite structure Behaviors as composites UML (lack of) support (Onto)logical modeling Summary

More Information Additional slides

– Starts with onto, includes interactions.– http://conradbock.org/bock-ontological-behavior-

modeling-jpl-slides.pdf

Paper: http://dx.doi.org/10.5381/jot.2011.10.1.a3

Application to BPMN:http://conradbock.org/#BPDM

KerML:– Contact Chas Galey [email protected]

34