The Unified Modelling Language
Perdita Stevens
(Perdita.Stevens@dcs.ed.ac.uk, http://www.dcs.ed.ac.uk/home/pxs/) Division of Informatics University of Edinburgh
Slide 1Objectives
A t the end- f
- y
- u
- y
- u
- f
- f
- f
- y
- u
- w
- ut
- P
The Unified Modelling Language Perdita Stevens - - PDF document
The Unified Modelling Language Perdita Stevens (Perdita.Stevens@dcs.ed.ac.uk, http://www.dcs.ed.ac.uk/home/pxs/) Division of Informatics University of Edinburgh Slide 1 Objectives A t the end of to da y: y ou will kno w what
(Perdita.Stevens@dcs.ed.ac.uk, http://www.dcs.ed.ac.uk/home/pxs/) Division of Informatics University of Edinburgh
Slide 1Book Copy is a copy of
This generalises: asso ciation b et w een classiers is alw a ys sho wn using a plain line. An instanceDirector of Studies Student directee DoS
Can sho w the role thatLibraryMember MemberOfStaff Book Copy Journal 1 1..* 1 0..* 1 0..* borrows/returns borrows/returns borrows/returns 1 0..* is a copy of
Commas for ranges, two dots for ranges, * for unkno wn n um b er. E.g. eac h Cop y is a cop yLibraryMember MemberOfStaff
This generalises: generalisation b et w een classiers is alw a ys sho wn using this arro w. Slide 21prints Stringifiable <<interface>> Stringifiable stringify() : String Module stringify() : String Printer ... <<uses>> ...
Slide 25A B
W e'v e seen them b et w een use cases and b et w een a class and an in terface: used generally for \relationship notStudent Module is taking 1..* 6
When should the na vigabilit yHonoursCourse Module 1..* 6..*
Non-exclusiv e part relationship. A common fault is iden tifying toBoard Square 9 1
Exclusiv e part relationship. Slide 31Board row:{1,2,3} column:{1,2,3} Square 1 1
Giv en a Board and a ro w and a column, can iden tify a Square. Slide 32 cStudent Module is taking Lecturer teaches course /teaches student
Record the asso ciation, but also that it's not indep enden t. Slide 33Student Module is taking is taking mark : int 1..* 6
asStudent Module is taking mark : int Mark 1 1 6 1..* 6 1..*
Slide 35T List add(t:T, pos:int) get(i:int) : T List<Game> StudentList <<bind>>(Student)
Slide 36 cBrowser Librarian JournalBorrower BookBorrower Reserve book Borrow copy of book Return copy of book Extend loan Borrow journal Update catalogue Browse Return journal
Slide 39<<include>> Extend loan Check for reservation BookBorrower Borrow copy
<<extend>> Refuse loan Borrow copy of book
Purp<<extend>> Refuse loan Borrow copy of book extension points too many books
Optionally , w e can do cumen t the decision pBookBorrower JournalBorrower
Slide 52 cCopy is a copy of Book Journal is a copy of {or} 0..1 0..1 1..* 1..* each volume separately
W rite the constrain tLibraryMember Copy theBook : Book theCopy : theLibraryMember : aMember : BookBorrower borrow(theCopy) 1: okToBorrow 2 :borrow 2.1: borrowed
Slide 63LibraryMember theLibraryMember : Copy theCopy : theBook : Book borrow(theCopy) 1: okToBorrow 2: borrow 2.1: borrowed aMember : BookBorrower
Slide 64 c2: borrow 2.1: borrowed :LibraryMember :Copy : Book 1: okToBorrow aMember : BookBorrower
Slide 65:Lecturer :DirectorOfStudies :UTO 1: n := getName() 2: new DirectorOfStudies (n) 3:destroy()
Slide 66 cEverythingController getJC(j:Job) : JobController 1 JobController 1 Job 1 0..* 0..* 0..*
Problems? Slide 68 cLibraryMember theLibraryMember : Copy theCopy : theBook : Book borrow(theCopy) 1: okToBorrow 2: borrow 2.1: borrowed {C - A < 5 sec} aMember : BookBorrower C A {borrowed’ - borrowed < 1 sec}
Slide 71[i = 0] foo() [i = 1] bar() m : Mung [i = 0] foo() [i = 1] bar() m : Mung
Slide 72 cm : Mung f : Froboz 7.1:[i = 0] foo() 7.2:[i = 1] bar()
Slide 733.1:*[i := 1..2] a() :Foo :Bar :Baz 3.1.1:b() 3.1:*[i := 1..2] a() 3.1.1:*[i := 1..2] b() :Foo :Bar :Baz
Slide 74 cAda Lovelace : CS4Student
:DirectorOfStudies email confirmChoice(m1,...,m6,self) chooseModules(m1,...m6) :Student
Slide 75return() borrow()
return()/^book.returned(self) borrow()/^book.borrowed(self)
Slide 82 cnot borrowable borrowable returned() borrowed()[ last copy] returned() borrowed()[not last copy]
Slide 84 creturn() borrow()
entry/book.borrowed(self) entry/book.returned(self)
Slide 85prepare for next member find book on shelf wait in queue borrowing record record return put book back
[borrower] [returner] [returning] [borrowing] member librarian
Slide 87streams.o library>> << MyApp <<executable>> MyIO <<link>> <<compile>>
Slide 90 cP Q A foo:?? B C R D E S
P ac k ages can app ear<<LAN>> ether C
craro : PC shillay : Workstation
Slide 95P2:PllayerInterface
OXO:GameEngine
P1:PlayerInterface
shillay : Workstation craro : PC <<LAN>> ether C
Slide 96 cserver
Scheduler MeetingsDB PersonalPlanner
dumb terminal workstation
PersonalPlanner
Slide 97Classifier Class Actor UseCase
Slide 105Director of Studies Student directee DoS
Single (?