CSCI 2300: Object-Oriented Software Design

The Object-Oriented Modeling (part 2)

Chapter Topics

Object and Class Concepts

Identifying Classes

Rule of thumb: Look for nouns in problem description

Identifying Classes

Focus on concepts, not implementation

Categories of Classes

Identifying Responsibilities

Rule of thumb: Look for verbs in problem description or User Story

Behavior of Board:

Responsibilities

Class Relationships

Relationship

Coupling

CRC Cards

CRC Cards

CRC Cards

Digital CRC Cards for Tic Tac Toe

Use Cases

Sample Use Case

Take your turn

Original design
  1. A player selects a board position for that player's game piece
  2. Board checks if selected position is available
  3. Board updates its game pieces
Alternative design
  1. Board presents a list of available board positions
  2. A player selects a board position (from the list of available) for that player's game piece
  3. Board updates its game pieces OR Player updates the board

Use Cases

Design these use cases in class

From Use Cases to CRC Cards

Update Digital CRC Cards for Tic Tac Toe

UML Diagrams

Class Diagrams

Class Diagrams

.

Class Relationships

.

Composition

.

Association

.
.

Interface Types

.

Tips