Pertemuan 23 Sequence Diagram Matakuliah : M0086/Analisis dan Perancangan Sistem Informasi Tahun : 2005 Versi : 5 Pertemuan 23 Sequence Diagram
Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : Mahasiswa dapat Menerangkan Sequence Diagram (C2) Mahasiswa dapat Membuat diagram / skema Sequence (C4)
Konsep dasar dan Notasi Time Constrains Branching and Recursion Outline Materi Konsep dasar dan Notasi Time Constrains Branching and Recursion Dialoque Management (Interface Classes) Modelling real-time systems and concurrency
What is Sequence Diagram? Sequence Diagram is a dynamic model of a use case, showing the interaction among classes during a specified time period. Sequence Diagram is used primarily to show the interactions between objects in the sequential order that those interactions occur. Illustrates how objects interacts with each other. Emphasizes time ordering of messages. Can model simple sequential flow, branching, iteration, recursion and concurrency.
What is Sequence .. (Cont’s) Illustrates how objects interacts with each other. Emphasizes time ordering of messages. Can model simple sequential flow, branching, iteration, recursion and concurrency.
Elements of Sequence Diagram Notasi Object Object Nama Object Lifeline Activation
Notasi Actor Actor (Initiator) Actor Lifeline Actor Activation Elements of (Con’t…….) Notasi Actor Actor Name Actor (Initiator) Actor Lifeline Actor Activation
Notasi Bentuk Panah Elements of (Con’t…….) filled solid arrowhead Procedure call or other nested flow of control. The entire nested sequence is completed before the outer level sequence resumes. The arrowhead may be used to denote ordinary procedure calls, but it may also be used to denote Concurrently active instances when one of them sends a Signal and waits for a nested sequence of behavior to complete before it continues. stick arrowhead Message ; that is, no nesting of control. The sender dispatches the Stimulus and immediately continues with the next step in the execution. dashed arrow with stick arrowhead Return from procedure call.
Elements of (Con’t…….) X-Axis (objects) Y-Axis (time) Synchronous Actor Synchronous message :A :B Procedure Call Asynchronous message Y-Axis (time) Return Synchronous message : the caller has to wait for the receiving object to complete execution of the called operation before it can resume execution. Asynchronous message : The caller can execute immediately after sending the message, it does not has to wait for the recipient to handle the message
Control information Condition syntax: ‘[‘ expression ’]’ message-label The message is sent only if the condition is true example: Iteration syntax: * [ ‘[‘ expression ‘]’ ] message-label The message is sent many times to possibly multiple receiver objects. :CompoundShape :Shape draw() *draw()
Recursion in SD :A Recursive
Object Creation An object may create another object via a <<create>> message :A <<create>> :B Object Contruction (Object Creation) Object Destruction (Object Deletion)
Branching A branch is shown by multiple arrows leaving a single point, each possibly labeled by a condition. Depending on whether the conditions are mutually exclusive, the construct may represent conditionality or concurrency. :B :C :A [Gaji >= PKP] Hitung Pajak() [Gaji < PKP] Hitung Gaji Bersih()
Contoh Berdasarkan Use Case Diagram ini kita akan membuat Sequence Diagram dan hasilnya adalah sebagai berikut
Contoh Pembuatan PO Dari Sequence Diagram ini dapat Dilihat bentuk dari Class Diagramnya
To be Continue…..
Object Object dalam Sequence Diagram digambar dengan segiempat yang berisi nama Object yang diberi garis bawah. syntax: [Obiect Name][:className] Object dapat diberi nama berdasarkan : Nama Object saja • Nama Class Saja Gabungan Nama Class dan Nama Object OOAD :Matakuliah OOAD:Matakuliah Back
Lifeline Tiap obyek juga mempunyai Lifeline (Biasa disebut juga dengan Timeline / Garis Waktu) yang direpresentasikan dengan garis putus-putus dibawah obyek Lifeline menggambarkan waktu selama Obyek yang diatas bisa berhubungan dengan obyek lain didalam use case. Back
Activation Activation digambarkan dengan bentuk empat persegi panjang sempit yang menutupi Lifeline. Activation menunjukkan kapan sebuah object mengirim atau menerima message. Back
Messages An interaction between two objects is performed as a message sent from one object to another (simple operation call, Signaling, RPC) If object obj1 sends a message to another object obj2 some link must exist between those two objects (dependency, same objects) A message is represented by an arrow between the life lines of two objects. Self calls are also allowed The time required by the receiver object to process the message is denoted by an activation-box. A message is labeled at minimum with the message name. Arguments and control information (conditions, iteration) may be included.