INFS 6225 Object Oriented Systems Analysis & Design Chapter 5: Structural Modeling
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 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 you? What do you know? What can you do? Helps to create CRC Cards
Structural Model: 2 Parts CRC Card (Class Responsibility Collaboration) Written form used to document responsibilities & collaborations of a class Used to build Class Diagram Class Diagram (similar to ER 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 : Collaborators: Back: Attributes: Relationships: Generalization (a-kind-of): Aggregation (has-parts): Other Associations:
Class Diagram
Class Diagram Components A CLASS AN ATTRIBUTE AN OPERATION AN ASSOCIATION Class 1 -attribute +operation () Attribute name/ derived attribute name operation name () 1..* 0..1 ______verb phrase____
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 Multiplicity Also called Cardinality Zero to One Zero to Many One to One One to Many Many to Many, et al.
Practice Exercises