Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

Sequence Diagram AND Communication Diagram Pertemuan 0102

Presentasi serupa


Presentasi berjudul: "Sequence Diagram AND Communication Diagram Pertemuan 0102"— Transcript presentasi:

1

2 Sequence Diagram AND Communication Diagram Pertemuan 0102
Matakuliah : M Analisis dan Perancangan Sistem Informasi Lanjut Tahun : Sequence Diagram AND Communication Diagram Pertemuan 0102

3 Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa
akan mampu : Mahasiswa dapat membuat diagram / skema sequence diagram (C4) Mahasiswa dapat membuat diagram / skema communication diagram (C4)

4 Outline Materi Konsep dasar dan Notasi Time Constrains
Branching and Recursion Dialoque Management (Interface Classes) Modelling real-time systems and concurrency

5 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.

6 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.

7 Elements of Sequence Diagram
Notasi Object Object Nama Object Lifeline Activation

8 Elements of (Con’t…….) Actor (Initiator) Actor Lifeline
Notasi Actor Actor Name Actor (Initiator) Actor Lifeline Actor Activation

9 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.

10 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

11 Control information :CompoundShape :Shape 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()

12 Recursion in SD :A Recursive

13 Object Creation An object may create another object via a <<create>> message :A <<create>> :B Object Contruction (Object Creation) Object Destruction (Object Deletion)

14 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()

15 Contoh Berdasarkan Use Case Diagram ini kita
akan membuat Sequence Diagram dan hasilnya adalah sebagai berikut

16 Contoh Pembuatan PO Dari Sequence Diagram ini dapat
Dilihat bentuk dari Class Diagramnya

17 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

18 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

19 Activation Activation digambarkan dengan bentuk empat persegi panjang sempit yang menutupi Lifeline. Activation menunjukkan kapan sebuah object mengirim atau menerima message. Back

20 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.

21 SEQUENCE DIAGRAM Sequence diagram for the use case Add a New Advert to a Campain

22 Sequence Diagram for the Use Case Add a New Advert to a Campaign
Didalam contoh diatas digambarkan sequence diagram untuk sequence Penambahan Advertising ke Campaign dengan langkah-langkah sebagai berikut: GetName / Pengambilan Nama dari Class Client Kemudian mengambil Detail Campaign (getCamplaignDetiails) dari Class Campaign dari listCampaign yang dibuat dalam Interation/pengulangan yang ditandai dengan kotak dengan tulisan LOOP Kemudian mengambil DetailAdverts (getAdvertDetiails) dari Class Campaign dari listAdverts yang dibuat dalam Interation/pengulangan yang ditandai dengan kotak dengan tulisan LOOP Kemudian dilanjutkan dengan AddNewAdvert ke class campaign dan dilanjutkan dengan penciptaan Object newAd:Advert dengan garis putus-putus Advert ( Konstraktor)

23 Contoh Constractor dengan Argumen
//* Contoh Konstuktor Dengan Argumen*/ #include <iostream.h> #include <conio.h> #include <string.h> class Buku { private: char judul[35]; char pengarang[25]; int jumlah; public: Buku(char *judul,char *pengarang, int jumlah); // Konstruktor void info(); }; void main() Buku novel("Siaga Merah","McLean",3); novel.info(); } // Definisi fungsi anggota Buku::Buku(char *judul,char *pengarang, int jumlah) strcpy(Buku::judul,judul); strcpy(Buku::pengarang,pengarang); Buku::jumlah=jumlah; void Buku::info() cout << "\nJudul =" << judul << endl; cout << "\nPengarang =" << pengarang << endl; cout << "\nJumlah =" << jumlah << endl; cout << endl; Pengisian data anggota adalah dengan menggunakan inisialisasi seperti dibawah ini: Step 1: Buku novel; Step 2: Novel.inisialisasi ("Siaga Merah","McLean",3); Dengan menggunakan Konstruktor, maka dua statement diatas disederhanakan dmenjadi sebuah statement seperti:

24 Contoh 2 Sequence dengan Control Objects

25 Contoh 2 Sequence Diagram for the Use Case Add a New Advert to a Campaign
Didalam contoh diatas digambarkan sequence diagram untuk sequence Penambahan Advertising ke Campaign dengan langkah-langkah sebagai berikut: 1. Didalam contoh ke 2 ini kita menggunakan Class baru Yaitu AddAdvertUI atau User Interface untuk AddAdvert 2. Kemudian mengambil Client (getClient) dari Class Client untuk mendapatkan data seluruh Client ( getClient) dari Class Client yang dibuat dalam Interation/pengulangan yang ditandai dengan kotak dengan tulisan LOOP 3. Kemudian Control Object Dibuat yaitu :AddAdvertUI yang ditandai dengan StartInterface 3.1 Baru di dalam :AddAdvertUI dilakukan selectClient 3.2 Kemudian diikuti dengan ShowClientCampaign yang kemudian dilanjutkan dengan getCampaignDetail didalam List Campaign dalam Loop untuk mendapatkan Campaign detail dari class Campaign dan hal ini di ulang untuk Mengambil Advert Detail dan terakhir dengan Create New Advert mengcreate newAd:Advert

26 Check Campaign Budget 1 2 3

27 Check Campaign Budget Sequence
1. Didalam Gambar 9.8 terdapat garis lifetime yang penuh yang menandakan adanya waktu terjadinya eksekusi proses didalam object tersebut 2. Di dalam gambar juga terdapat garis panah yang putus-putus yang menandakan adanya return dari proses tersebut 3. Di dalam gambar didalam mengambil Overhead terjadi pengulangan dan returnnya pun terjadi pengulangan

28 Sequence with 1.* Min Interation1, * Max interation

29 Branching

30 Branching Dari gambar diatas terdapat keyword alt yang berarti alternatives , dari contoh diatas maka terdapat logika pertama mengambil campaign budget atau get campaign budget didalam frame ref kemudian akan dicek kondisinya jika total cost < = budget baru bisa add newAd:Advert

31 Communication Diagram

32 What is Communication Diagram?
Communication diagram have many similarities to sequence diagram. The most significant different between the two types of interaction diagram is the communication diagram explicitly shows the links between the lifelines that participate in a collaboration. Unlike sequence diagram there is no explicit time dimension and lifelines are represented only by rectangles

33 Communication Diagram

34 Communication Diagram
1 2 3.1.1 3 3.1 4 4.1 4.1.1 5 5.1 5.1.1

35 Cara Membuat Communication Diagram
Ambil dari Sequence diagram gambar 9.5 Kemudian urutkan setiap event dengan diberi no Kemudian hubungkan antar class dan tuliskan setiap hubungan yang sudah diberikan no


Download ppt "Sequence Diagram AND Communication Diagram Pertemuan 0102"

Presentasi serupa


Iklan oleh Google