2. Sequence Diagram
Menggambarkan interaksi antar objek di dalam dan di
sekitar sistem (termasuk pengguna, display, dan
sebagainya) berupa message yang digambarkan
terhadap waktu
Biasa digunakan untuk menggambarkan skenario atau
rangkaian langkah-langkah yang dilakukan sebagai
respons dari sebuah event untuk menghasilkan output
tertentu.
Diawali dari apa yang men-trigger aktivitas tersebut,
proses dan perubahan apa saja yang terjadi secara
internal dan output apa yang dihasilkan.
3. Sequence Diagram
Sequence diagram terdiri atas:
Dimensi vertikal (waktu)
Dimensi horizontal (objek-objek yang terkait).
Masing-masing objek, termasuk aktor, memiliki
lifeline vertikal.
Diagram ini secara khusus berasosiasi dengan
use case diagram
Memperlihatkan tahap demi tahap apa yang
seharusnya terjadi untuk menghasilkan sesuatu
didalam use case
6. Partisipant / Object Lifeline
Pada UML 1 disebut dengan nama Obyek
Diletakkan dari kiri ke kanan
Setiap Partisipant terhubung dengan lifeline
Standar penamaan
Instance Name : Class Name
7. Time / Lifeline
Mewakili waktu pada arah vertikal, dimulai dari
atas ke bawah
Garis putus-putus yang menempel di partisipant
lifeline
8. Action
Mewakili sebuah eksekusi operasi dari
partisipant
Kotak kecil segiempat di lifeline
Panjang kotak berbanding lurus dengan durasi
activation
9. Message
Message berpindah dari 1 lifeline ke lifeline
yang lain
Message yan pertama kali muncul di SSD
terletak paling atas, kemudian message yang
berikutnya berada di bawahnya
Terdapat 3 macam :
Synchronus
Asynchronus
Reply / Return
10. Message…
Synchronous
● Pesan yang dikirim oleh 1 obyek ke
obyek lain dan obyek pertama
menunggu sampai hasil aksi
selesai.
Asynchronous
● Pesan yang dikirim oleh 1 obyek ke
obyek lain dan obyek pertama tidak
menunggu sampai hasil aksi
selesai.
Reply/Return
● Menunjukkan nilai kembali dari
obyek ke obyek yang mengirim
pesan
11. Message …
the analyst object makes a call to the system object which is an instance of
the ReportingSystem class.
The analyst object is calling the system object's getAvailableReports
method.
The system object then calls the getSecurityClearance method with the
argument of userId on the secSystem object, which is of the class type
SecuritySystem
the secSystem object returns userClearance to the system object when the
getSecurityClearance method is called.
The system object returns availableReports when the getAvailableReports
method is called.
15. Recursive
Suatu Obyek yang memanggil dirinya sendiri
Digambarkan dengan menambah kotak kecil pada
activation
Cotoh : system object memberi pesan ke dirinya sendiri :
menentukan Laporan apa saja yang ada
17. Petunjuk membuat SD
1. Mengacu ke skenario Use Case / Stimulus-
Response
2. Identifikasi participant objects
3. Gambar lifelines untuk tiap object
4. Gambar duration tiap object pada lifeline
5. Tambahkan object messages dari atas ke
bawah pada diagram (time-based)
6. Check ulang diagram untuk
kelengkapannya
18. Guards
Kondisi : suatu syarat agar message dikirim
the guard is the text "[pastDueBalance = 0]." By having the
guard on this message, the addStudent message will only be
sent if the accounts receivable system returns a past due
balance of zero
19. Combined fragments
digunakan untuk mengelompokkan
message, tergantung kondisi tertentu
disebut juga Interaction Fragment
(Kerangka Interaksi)
UML 2 specification mengidentifikasi 11
operator untuk combined fragments.
20. Format Combined
op (operator):
applied to the enclosed interaction(s)
(some operators require arguments, such as diagrams names,
parameters, constants and guards)
[guard]:
a boolean expression
the interaction is executed according
to the guard’s value
diagram name:
needed if we want to refer to a diagram defined elsewhere
interaction:
a (fragment of a) sequence diagram (it can
contain other frames)
if we need to enclose more interactions,
we’ll separate them with an outlined line
(see next slide)
op [:arguments]
diagram name | interaction
[ [guard] ]
21. Contoh
satu set interactions dipisahkan dengan garis
putus-putus
interaction_i dijalankan jika guard_i bernilai
benar
op
interaction_1
[guard_1]
…
interaction_n
[guard_n]
22. Operator Combined Fragment
Alternatives (alt)
choice of behaviors – at most one will execute
depends on the value of the guard (“else” guard
supported)
Option (opt)
Special case of alternative hanya berisi 2 pilihan
Break (break)
Represents an alternative that is executed instead of
the remainder of the fragment (like a break in a loop)
Parallel (par)
Concurrent (interleaved) sub-scenarios, fragmen
berjalan secara pararel
Negative (neg)
Identifies sequences that must not occur (interaksi
yang salah)
23. Operator…
Critical Region (region)
Fragmen tidak dapat disela dengan kejadian lain
pada participating lifeline
Loop (loop)
Optional guard: [<min>, <max>, <Boolean-
expression>]
Tanpa Guard berarti tidak ada batas
25. Option
if a student's past due balance equals zero, then the addStudent,
getCostOfClass, and chargeForClass messages are sent. If the student's past
due balance does not equal zero, then the sequence skips sending any of the
messages in the option combination fragment.
29. Break
almost identical in every
way to the option combined
fragment, with two
exceptions.
a break's frame has a
namebox with the text
"break" instead of "option."
when a break combined
fragment's message is to be
executed, the enclosing
interaction's remainder
messages will not be
executed because the
sequence breaks out of the
enclosing interaction
Breaks are most commonly
used to model exception
handling
32. Contoh SD Pemesanan Buku
Put in shopping cart
Verify availability
Return availability
Buy shopping cart
Verivy customer
Send order
Return Customer chek
Customer
Cart Catalog Authentication Order
Proses pemesanan buku
36. Latihan
1. Amati Halaman Kuliah online dan content
yang terdapat pada kuliah online beserta
inputan, proses dan outputnya
2. Berdasarkan pengamatan anda buatlah
diagram use case, scenario, activity dan
sequence.