OOAD – TI S1 Defri Kurniawan UDINUS BEHAVIORAL MODELS OOAD – TI S1 Defri Kurniawan UDINUS
Purpose of Behavioral Models [1] Menunjukkan bagaimana objek berkolaborasi untuk mendukung setiap use case Untuk menunjukkan efek dari proses yang bervariasi pada sistem
What is interaction diagram [2] Interaction Diagram menunjukkan bagaimana kelompok-kelompok objek saling berkolaborasi dalam beberapa behaviour. Sequence Diagram merupakan diagram yang paling umum digunakan untuk menunjukkan interaksi
Interaction Diagram Components [1] Objects Instantiation of a class Operations Behaviors of the objects Send and receive messages Perform internal calculations Messages Calls to the object to perform the operations
Sequence Diagrams [1] Menggambarkan objek yang berpartisipasi dalam use case Menampilkan pesan yang melewati antara objek untuk use case tertentu dari waktu ke waktu
Sequence Diagram Syntax [1] AN ACTOR AN OBJECT A LIFELINE A FOCUS OF CONTROL A MESSAGE OBJECT DESTRUCTION anObject:aClass aMessage() x
Example Sequence Diagram for Make Appointment Use Case [1]
Example sequence diagram [3]
Sequence Diagram [2] Sebuah sequence diagram menjabarkan behavior sebuah skenario tunggal Sequence diagram menunjukkan interaksi dengan menampilkan setiap partisipan dengan garis alir secara vertikal dan pengurutan pesan dari atas ke bawah.
Jenis Class Boundary Class: Control Class: Entity Class: Class yang berinteraksi dengan aktor langsung (user interface) Form, input, UI ini masuk di sini Control Class: Class yang berhubungan dengan pemrosesan, penghitungan, kalkulasi, komputasi, query, dst Entity Class: Class yang berhubungan dengan data, penyimpanan data/file
Use Case Diagram Sistem ATM
Sequence Diagram: Memasukkan Kartu
Sequence Diagram: Memasukkan PIN
Sequence Diagram: Mentransfer Uang
Sequence Diagram: Melakukan Logout
Collaboration Diagrams [1] Essentially an object diagram that shows Message passing relationships Instead associations Emphasize The flow of messages among objects Rather than timing and ordering of messages
Collaboration Diagram Syntax [1] AN ACTOR AN OBJECT AN ASSOCIATION A MESSAGE anObject:aClass aMessage()
Example Collaboration Diagram [1]
Example Collaboration Diagram [3]
Behavioral State Machine [1] Seringkali beberapa objek memiliki beberapa perubahan kondisi/keadaan/status (state) Diantaranya perubahan tersebut tidak kembali lagi seperti state awal Patient: new current former The behavioral state machine merupakan model dinamis yang menunjukkan hal tsb
Behavioral State Machine (cont) The behavioral state machine shows The different states of an object The events That cause the object to change from one state to another
Components of Statechart Diagrams [1] States Ditentukan oleh nilai (value) dari atribut (Determined by the values of the attributes) Events Changes the state of an object e.g. changes the values of attributes
Components of Statechart Diagrams (cont) Transitions Movement of an object from one state to another Often has a guard condition Actions Atomic process, takes "zero time" Activities Non-atomic, take a long time, can be started and stopped
Statechart Diagram Syntax A STATE AN INITIAL STATE A FINAL STATE AN EVENT A TRANSITION aState anEvent
Example Behavioral State Machine Diagram
Building Behavioral State Machine Diagrams Set the context Identify Initial state Final state All stable states Determine the order in which the object will pass through stable states Identify the events, actions, and guard conditions associated with the transitions Validate the diagram
Refrence [1] Alan Dennis et al, Systems Analysis and Design with UML – 3rd Edition, John Wiley and Sons, 2010 [2] Martin Fowler, UML Destilled – 3rd Ed., A brief Guide to the Standar Object Modeling Language, Pearson Educatin, Inc., 2004 [3] OOAD with UML Object Oriented Analysis and Design Using the UML