Structural Modelling Tujuan Memahami aturan dan notasi class

  • Slides: 31
Download presentation
Structural Modelling

Structural Modelling

Tujuan Memahami aturan dan notasi class dan object diagram l Memahami langkah-langkah pembuatan class

Tujuan Memahami aturan dan notasi class dan object diagram l Memahami langkah-langkah pembuatan class dan object diagram l Memahami keterkaitan antara use-case dan structural model l Slide 2

Deskripsi A structural model describes the structure of the data that supports the business

Deskripsi A structural model describes the structure of the data that supports the business process in an organization. l During the analysis phase, the structural model presentas the logical organization of data without indicating how the data are stored, created, or manipulated. l Analysts need to understand the information that is used and created by the system l A structural model is a formal way of representing the objects that are used and created by a business system. l Slide 3

It illustrates people, places, or things about which information is captured and how they

It illustrates people, places, or things about which information is captured and how they are related to each other. l At this stage, the structural models doesn’t represent software component or classes in an OO programming language. l It should represent the responsibilities of each class and the collaborations between the classes. l Structural models are depicted using CRC cards, class diagram, and object diagram l Slide 4

Tujuan Structural Modelling Reduce the “semantic gap ” between the underlying problem domain and

Tujuan Structural Modelling Reduce the “semantic gap ” between the underlying problem domain and the evolving structural model. l Create a vocabulary that can be used by both the analyst and users. l Represent the things, ideas, or concepts, that is, the objects, contained in the domain of the problem and their relationships. l Slide 5

Classes l Templates for creating instances or objects Concrete l Abstract l l Typical

Classes l Templates for creating instances or objects Concrete l Abstract l l Typical examples: l l Application domain, user interface, data structure, file structure, operating environment, document, and multimedia classes Atributes : Units of information relevant to the description of the class l Only attributes important to the task should be included l Slide 6

l Operations : Action that instances/objects can take l Focus on relevant problem-specific operations

l Operations : Action that instances/objects can take l Focus on relevant problem-specific operations (at this point) l Slide 7

Relationship l Generalization Enables inheritance of attributes and operations l Example : staff dan

Relationship l Generalization Enables inheritance of attributes and operations l Example : staff dan nurse l l Aggregation Relates parts to wholes l Example : house dan door, window l l Association Miscellaneous relationships between classes l Example : patient dan appointment l Slide 8

CLASS-RESBONSIBILITYCOLLABORATION CARD

CLASS-RESBONSIBILITYCOLLABORATION CARD

Content l Responsibilities Knowing l Doing l l Collaboration l Objects working together to

Content l Responsibilities Knowing l Doing l l Collaboration l Objects working together to service a request Slide 10

A CRC Card Slide 11

A CRC Card Slide 11

Slide 12

Slide 12

CLASS DIAGRAM

CLASS DIAGRAM

Notasi Class Diagram A CLASS Class. Name -attribute +operation () AN ATTRIBUTE AN OPERATION

Notasi Class Diagram A CLASS Class. Name -attribute +operation () AN ATTRIBUTE AN OPERATION AN ASSOCIATION Attribute name/ derived attribute name operation name () 1. . * 0. . 1 ______verb phrase____ Slide 14

Example Slide 15

Example Slide 15

Atribut l Derived attributes l l /age, for example can be calculated from birth

Atribut l Derived attributes l l /age, for example can be calculated from birth date and current date Visibility Public (+) l Protected (#) l Private (-) l Slide 16

Operasi l Constructor Creates object l Typically not written explicitly on the class diagram

Operasi l Constructor Creates object l Typically not written explicitly on the class diagram l l Query l l Makes information about the state of an object available to other objects Update l Changes values of some or all attributes Slide 17

Relationship l Tepat satu Department l l Boss Sebuah Department hanya memiliki satu Boss

Relationship l Tepat satu Department l l Boss Sebuah Department hanya memiliki satu Boss Nol atau lebih Employee l l 1 0. . * Child Satu Employee memiliki nol atau banyak Child Satu atau lebih Boss l 1. . * Employee Satu Boss memimpin satu atau lebih Employee Slide 18

l Nol atau satu Employee l l Spouse Seorang Employee dapat menikah dengan nol

l Nol atau satu Employee l l Spouse Seorang Employee dapat menikah dengan nol atau satu pasangan Kisaran tertentu Employee l l 0. . 1 2. . 4 Vacation Seorang Employee dapat memperoleh jatah Vacation 2 hingga 4 kali per tahun Multiple, disjoint ranges Employee l 1. . 3, 5 Comitte Seorang Employee adalah anggota dari satu hingga tiga atau lima komite Slide 19

Sometimes a relationship has associated properties, especially when its classes share a many-to-many relationship.

Sometimes a relationship has associated properties, especially when its classes share a many-to-many relationship. l In these cases, a class is formed, called an association class l Example : l Gejala Penyakit Pengobatan Slide 20

Generalization & Aggregation l Generalization : Occurs when we need to use words as

Generalization & Aggregation l Generalization : Occurs when we need to use words as “is a-kind-of” to describe the relationship. l Example : the blue line l l Aggregation Classes actually comprises other class l Example : the red line l Slide 21

Object Diagram Slide 22

Object Diagram Slide 22

Object Identification l Common approaches : Textual analysis l Common object lists l Patterns

Object Identification l Common approaches : Textual analysis l Common object lists l Patterns l Slide 23

Textual Analysis l l Analysis of the text in the use-case descriptions Starts by

Textual Analysis l l Analysis of the text in the use-case descriptions Starts by reviewing the use-case descriptions and the use-case diagrams. Identify potential objects, attributes, operations, and relationships. The nouns possible classes, the verbs possible operations Slide 24

Common Object List Simply list the objects that are common to the business domain

Common Object List Simply list the objects that are common to the business domain of the system. l Several categories : l things l incidents l roles l interactions l Slide 25

Patterns Is a useful group of collaborating classes that provide a solution to a

Patterns Is a useful group of collaborating classes that provide a solution to a commonly occurring problem. l For example : many business transactions involve the same type of objects and interactions : l a transaction class l a transaction line item class l an item class l a location class l a participant class l Slide 26

Steps for Object Identification and Structural Modeling 1. Create CRC cards by performing textual

Steps for Object Identification and Structural Modeling 1. Create CRC cards by performing textual analysis on the use-cases. 2. Brainstorm additional candidate classes, attributes, operations, and relationships by using the common object list approach. 3. Role-play each use-case using the CRC cards. 4. Create the class diagram based on the CRC cards. 5. Review the structural model for missing and/or unnecessary classes, attributes, operations, and relationships. 6. Incorporate useful patterns. 7. Review the structural model. Slide 27

Class Tasks 1. Gambarlah class diagram untuk kelas-kelas berikut : Movie (title, producer, length,

Class Tasks 1. Gambarlah class diagram untuk kelas-kelas berikut : Movie (title, producer, length, director, genre) Ticket (price, adult or child, showtime, movie) Patron (name, adult or child, age) 2. Gambarlah class diagram untuk kelas-kelas berikut : Patient (age, name, hobbies, blood type, occupation, insurance carrier, address, phone) Insurance carrier (name, number of patients on plan, address, contact name, phone) Doctor (speciality, provider identification number, age, phone, name) Slide 28

3. Gambarkan relasi-relasi berikut : Seorang pasien hanya boleh mendaftar ke seorang dokter, dan

3. Gambarkan relasi-relasi berikut : Seorang pasien hanya boleh mendaftar ke seorang dokter, dan seorang dokter boleh memeriksa banyak pasien b) Seorang pegawai dapat memiliki satu ekstensi telpon, dan satu nomor ekstensi telpon hanya diberikan untuk satu pegawai c) Sebuah teater dapat menayangkan banyak filem dan sebuah film dapat ditayangkan di banyak teater a) Slide 29

4. Buatlah class diagram untuk situasi berikut : Saat pasien pertama kali berkonsultasi, mereka

4. Buatlah class diagram untuk situasi berikut : Saat pasien pertama kali berkonsultasi, mereka harus mengisi informasi pasien yang berisi data tentang nama, alamat, nomor telpon, dan asuransi yang disimpan di file informasi pasien. Pasien hanya dapat terdaftar pada satu asuransi. Seorang pasien hanya dapat berkonsultasi dengan seorang dokter. Setiap kali pasien mengunjungi dokter, sebuah klaim asuransi dikirim kepada pihak asuransi berkaitan dengan pembayaran. Klaim berisi informasi kunjungan yaitu tentanggal, tujuan, dan biaya. Seorang pasien bisa mengajukan maksimal 2 klaim di hari yang sama. Slide 30

Tugas Kelompok Buat paper tentang : Object Based Formal Specification (OBFS) l Aturan :

Tugas Kelompok Buat paper tentang : Object Based Formal Specification (OBFS) l Aturan : l Minimal berasal dari 2 jurnal l Tulisan dalam bahasa Indonesia dengan struktur dan tata bahasa yang tepat. l Ditulis di kertas A 4, minimal 5 halaman (tidak termasuk cover). l Cantumkan referensi yang digunakan l Dikumpulkan via email dalam format pdf paling lambat 2 Juni 2011 l Slide 31