Rebooting the UML

27
1 Rebooting the UML Emphasising “Language” Over “Modelling” Phil Robinson LonsdaleSystems.com

description

It is more than 10 years since the author gave his first presentation on the UML at an Oracle conference in Perth. Since then, many would argue that the UML has failed to take the world by storm. Some see the popularity of Agile techniques as a backlash against bloated “methodologies” that advocate “modelling for modelling’s sake”. This paper takes a second look at the “Unified Modelling Language” and argues that perhaps the mistake has been to place too much emphasis on "modelling" and not enough on "language". The session is packed with practical tips on how to apply the UML in new and innovative ways. Presented at WA Oracle User Conference (AUSOUG) 2009 - voted best paper.

Transcript of Rebooting the UML

Page 1: Rebooting the UML

LonsdaleSystems.com 1

Rebooting the UMLEmphasising “Language” Over “Modelling”

Phil Robinson

LonsdaleSystems.com

Page 2: Rebooting the UML

LonsdaleSystems.com 2

AUSOUG Conference

1999

Mmmm… Wonder what I will be doing in 10 years

time?

Page 3: Rebooting the UML

LonsdaleSystems.com 4

Formed or united into a whole

UNIFIED

Page 4: Rebooting the UML

LonsdaleSystems.com 5

The act of representing something (usually on a smaller scale)

MODELLING

Page 5: Rebooting the UML

LonsdaleSystems.com 6

A systematic means of communicating by the use of sounds or conventional symbolsLANGUAGE

Page 6: Rebooting the UML

LonsdaleSystems.com 7

Software Development Languages

Low

High

HighLow

AmbiguityR

igo

ur

Program code

Natural language

Box and arrow diagrams

Page 7: Rebooting the UML

LonsdaleSystems.com 8

Program Code

• Compiler enforces rigour

• Testing resolves ambiguity

Page 8: Rebooting the UML

LonsdaleSystems.com 9

Mary had a little lamb

Natural LanguageRigour

• Word types– Noun– Adjective– Verb– Adverb

• Word order– Subject Verb Object

little

Adjective

lamb

Noun

a little lamb

Object

had

Verb

Verb

Mary

Noun

Subject

Page 9: Rebooting the UML

LonsdaleSystems.com 10

Natural languageAmbiguity

• … the 500 words used most in the English language …

• … each have an average of 23 different meanings …

Oxford English Dictionary

Page 10: Rebooting the UML

LonsdaleSystems.com 11

“Have” verb and auxiliary verb; past plural “Had”1. to possess; own; hold for use;

contain2. to hold, possess, or accept in

some relation, as of kindred or relative position

3. to get, receive, or take 4. to experience, undergo, or

endure, as joy or 5. to hold in mind, sight, etc6. to cause to, as by command or

invitation7. to be related to or be in a

certain relation to8. to show or exhibit in action or

words9. to be identified or distinguished

by; possess the characteristic of

10. to engage in or carry on

11. to partake of; eat or drink12. to permit or allow13. to assert, maintain, or represent

as being14. to know, understand, or be

skilled in15. to beget or give birth to16. to hold an advantage over17. to outwit, deceive, or cheat18. to control or possess through

bribery; bribe 19. to gain possession of20. to hold or put in a certain

position or situation21. to exercise, display, or make use

of22. to invite or cause to be present

as a companion or guest

Page 11: Rebooting the UML

LonsdaleSystems.com 12

“Lamb” noun

1. a young sheep 2. the meat of a young sheep 3. a person who is gentle, meek or

innocent4. a person who is easily cheated or

outsmarted

Page 12: Rebooting the UML

LonsdaleSystems.com 13

Natural LanguageAmbiguity

• Mary possessed a young sheep• Mary eat a small portion of meat from a young sheep• Mary received a small portion of meat from a young

sheep• Mary took a small portion of meat from a young sheep• Mary gave birth to a young sheep• Mary had in mind a gentle person• Mary possessed the characteristics of an innocent

person• Mary invited an innocent person• Mary cheated a naive person• Mary controlled an inexperienced person

Page 13: Rebooting the UML

LonsdaleSystems.com 15

Box and Arrow Diagrams

Page 14: Rebooting the UML

LonsdaleSystems.com 16

Box and arrow diagrams

Languages and Software Development

Low

High

HighLow

AmbiguityR

igo

ur

Program code

Natural languageUML

Page 15: Rebooting the UML

LonsdaleSystems.com 17

UML Symbols

Actor

Use Case

PackageClass

Component

«artifact»Artifact

Node

Object

Vocabulary

Page 16: Rebooting the UML

LonsdaleSystems.com 18

UML Repository

UML Meta-ModelArtifactObjectClass

PackageActor

Use CaseNode

Component

RepositoryPersonDriver

PassengerCarTrip

Car Car

Diagrams

Box and arrow diagrams

Grammar

Page 17: Rebooting the UML

LonsdaleSystems.com 19

UML Object Diagrams

mary :Person

age < 10 years

:Sheep

age < 6 months

mary :Sheep

gender = femaleage > 18 months

:Sheep

age = 0

mary :Person lamb :Meal

portion size = small

mary :Person :Person

personality = naieve

had pet

mother had offspring

diner had

con artist had victim

Page 18: Rebooting the UML

LonsdaleSystems.com 20

UML Class Diagrams

public class Chair {

private ChairStyle style;private float minHeight;private float maxHeight;private boolean isAdjustableHeight;

public sit(Person occupant){…

}

public stand(Person occupant){…

}

}

public enum ChairStyle {Dining,Lounge,Sofa,Swivel,Reclining,Stool

}

Chair

- style: ChairStyle- minHeight: float- maxHeight: float- hasAdjustableHeight: boolean

+ sit(occupant :Person)+ stand(occupant :Person)

«enumeration»ChairStyle

Dining Lounge Sofa Swivel Reclining Stool

Page 19: Rebooting the UML

LonsdaleSystems.com 21

UML Class Diagrams

Chair

responsibilitiesIndicate statusSupport people

Page 20: Rebooting the UML

LonsdaleSystems.com 22

UML Class Diagrams

Chair

responsibilitiesIndicate statusSupport people

constraints{height >= 40 cm}{height <= 85 cm}{must be stable}{must be comfortable}

Page 21: Rebooting the UML

LonsdaleSystems.com 23

UML Class Diagrams

Chair

responsibilitiesIndicate statusSupport people

constraints{height >= 40 cm}{height <= 85 cm}{must be stable}{must be comfortable}

Table

responsibilitiesProvide social organisationSupport objects

constraints{height >= 50 cm}{height <= 1.2 m}{must be stable}

0..*

Arranged around

{at any instant in time}

organises

0..1

0..*

Arranged around

{over time}

organises

1..*

Page 22: Rebooting the UML

LonsdaleSystems.com 24

UML Class Diagrams

ChairLeg

responsibilitiesProvide stabilitySupport seat

constraints{capable of supporting a person}

Chair

responsibilitiesIndicate statusSupport people

constraints{height >= 40 cm}{height <= 85 cm}{must be stable}{must be comfortable}

part 1..4

Page 23: Rebooting the UML

LonsdaleSystems.com 25

UML Class Diagrams

Chair

responsibilitiesIndicate statusSupport people

constraints{height >= 40 cm}{height <= 85 cm}{must be stable}{must be comfortable}

Suite

responsibilitiesEnsure consistent style

constraints{chairs must have matching styles}

member 2..*

Page 24: Rebooting the UML

LonsdaleSystems.com 26

Chair

responsibilitiesIndicate statusSupport people

constraints{height >= 40 cm}{height <= 85 cm}{must be stable}{must be comfortable}

Table

responsibilitiesProvide social organisationSupport objects

constraints{height >= 50 cm}{height <= 1.2 m}{must be stable}

Furniture{abstract}

responsibilitiesSatisfy symbolic or religous purposesSupport human activities

Cabinet

responsibilities::Storage

Store objects::Furniture

Support human activitiesSatisfy symbolic or religous purposes

Safe

responsibilitiesProvide secure object storage

::StorageStore objects

::FurnitureSupport human activitiesSatisfy symbolic or religous purposes

constraints{must have a locking mechanism}

Bookcase

responsibilitiesDisplay booksStore books

::StorageStore objects

::FurnitureSupport human activitiesSatisfy symbolic or religous purposes

Wardrobe

responsibilitiesStore clothes

::StorageStore objects

::FurnitureSupport human activitiesSatisfy symbolic or religous purposes

Storage{abstract}

responsibilitiesStore objects

::FurnitureSupport human activitiesSatisfy symbolic or religous purposes

UML Class Diagrams

Page 25: Rebooting the UML

LonsdaleSystems.com 27

UML Activity Diagram

:Chair

Stackchairs

«centralBuffer»chair stack

:Chair

:Chair

:Chair

Arrangechairs

Page 26: Rebooting the UML

LonsdaleSystems.com 28

UML State Machine Diagram

Stacked

+ do / store+ exit / check for damage

Arranged

+ entry / wipe clean+ do / use

/Stack chairs /Arrange chairs

Page 27: Rebooting the UML

LonsdaleSystems.com 29

Rebooting the UMLEmphasising “Language” Over “Modelling”

Questions

conference.lonsdalesystems.com

LonsdaleSystems.com