5 Structural Modeling 13 Januari 2016 Class Diagram

  • Slides: 20
Download presentation
5 -Structural Modeling 13 Januari 2016 Class Diagram

5 -Structural Modeling 13 Januari 2016 Class Diagram

Writing Effective Use Case

Writing Effective Use Case

Structural Models • Represents the data used & created by a system • Describes

Structural Models • Represents the data used & created by a system • Describes data captured & how data relate to each other • Are logical models • Are technology-independent (in Analysis Phase) • Typically used for “To Be” System

Relationships in Structural Modeling • Generalization – “is a kind of” ex. Employee is

Relationships in Structural Modeling • Generalization – “is a kind of” ex. Employee is a kind of Person • Aggregation – “is a part of” ex. Door is a part of a Car • Association – “catch all” ex. Patient & Appointment are Associated

Anthropomorphism • To treat classes as if they were human. Who or what are

Anthropomorphism • To treat classes as if they were human. Who or what are you? • What do you know? • What can you do? • • Helps to create CRC Cards

Structural Model: 2 Parts 1. CRC Card (Class Responsibility Collaboration) • • 2. Written

Structural Model: 2 Parts 1. CRC Card (Class Responsibility Collaboration) • • 2. Written form used to document responsibilities & collaborations of a class Used to build Class Diagram • Graphical model of classes & relationships among classes CRC Cards are created first; Class Diagrams are then created from CRC Cards

CRC Cards Front: Class name: ID: Type: Description: Responsibilities: Back: Attributes: Relationships: Generalization (a-kind-of):

CRC Cards Front: Class name: ID: Type: Description: Responsibilities: Back: Attributes: Relationships: Generalization (a-kind-of): Aggregation (has-parts): Other Associations: Collaborators:

Class Diagram Components A CLASS Class 1 -attribute +operation () AN ATTRIBUTE AN OPERATION

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

Use-case: Appointment System

Use-case: Appointment System

Class Diagram: Appointment System

Class Diagram: Appointment System

Notes on Attributes • Derived Attributes “/” calculated from other attributes ex. Age •

Notes on Attributes • Derived Attributes “/” calculated from other attributes ex. Age • Public Attributes “+” Not hidden from any other object • Protected Attributes “#” Hidden from other objects (except subclasses) • Private Attributes “-” Hidden from all other objects

Notes on Relationships • A Class can be related to itself • Relationships involve

Notes on Relationships • A Class can be related to itself • Relationships involve Multiplicity • • • Also called Cardinality Zero to One Zero to Many One to Many to Many, et al.

Multiplicity

Multiplicity

Association Class

Association Class

Generalization

Generalization

Aggregation (Logical) & Composition (Physical) Logical implies that it is possible for a part

Aggregation (Logical) & Composition (Physical) Logical implies that it is possible for a part be associated with multiple wholes or that is relatively simple for the part to be removed from the whole Physical implies that the part can be associated with only a single whole.

Object Diagram (instance constructor)

Object Diagram (instance constructor)

Textual Analysis of Requirements

Textual Analysis of Requirements

Praktek • Tunjukkan: use-case dan activity diagram • Mulai kembangkan class diagram (besok akan

Praktek • Tunjukkan: use-case dan activity diagram • Mulai kembangkan class diagram (besok akan dikontrol) • PR (nilai Kuis 3, kumpul besok 14 Januari 2016): Berikan penjelasan selengkap-lengkapnya untuk use-case dan activity diagram yang telah dikembangkan • Carilah informasi yang memadai untuk diagram kelakuan (behavioral diagrams) sbb: • 1. 2. 3. Sequence Communication Behavioral State