CH 06 Considering Objects Q Set Class Type
CH 06: Considering Objects Q Set, Class, Type f…of… Q Objects, Actors, Agents f. Data and Actions • Object-Oriented Design and Development • Intro to UML (Unified modeling Language) Q Diagrams TECH CH 01 Computer Science
Class vs. Object • A class is a collection, a group, a set, or a type of … e. g. Q People Q Student • An object is an instance or an individual of a class e. g. Q People Tom Q Student Marry
Class and its UML Box • Data Q State, attributes • Behavior Q Action, transformation, operation f. Triggered by receipt of particular message, or entrance into a particular state
Relations between Classes • Subclass e. g. Q People f. Student • Hierarchy • Inheritance (is-a)
Association relation between classes • • Public Class Employee { public String last. Name; … public Address home. Address; … } • Public class Address { … } Employee -last. Name : String … -home. Address
Association relation between classes (bidirectional) • • • Public Class Team { Team Linked. List members = new Lisnked. List(); … } • Public class member { Team member. Of; … } Member
Composition and Aggregation
Dependency • A dependency exists between the two if a class uses another class in some fashion
Using Class Diagram to show a design
More UML diagrams
Use case diagram
Activity Diagram
State Diagram
Sequence Diagram
Collaboration Diagram
Package Diagram
OO Design • Identify classes Q A set of objects sharing a common structure and common behaviors Q Looking for Things (nouns) f. Structures f. External systems f. Devices f. Roles f. Operating procedures f. Places f. Organizations f. Things that are manipulated by the system to be builds Q Behaviors f. Verbs
OO Measurement: Metric
- Slides: 18