(24) Object Oriented Design

(24) Object Oriented Design - Applying object-oriented...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CMSC 132: Object-Oriented Programming II Object-Oriented Design Department of Computer Science University of Maryland, College Park 2 Applying object-oriented design 1. Look at objects participating in the system Nouns may represent classes needed Relationships (e.g., “has” or “belongs to”) may represent fields of classes 2. Look at interactions between objects Verbs may represent messages between objects 3. Design classes accordingly Determine relationships between classes Find the state and methods needed for each class 3 Classes A class or interface defines and describes a set of objects It describes a set of methods or messages that the object responds to Not only the name and signature of the method, but the contract the method respects Classes also provide/describe fields and method implementations 4 Finding classes Analyze each noun in the problem statement Does the noun represent a class needed in the design? A noun may be outside the system A noun may describe the state of a class The decision is not always clear It's possible to make everything its own class but that
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/16/2011 for the course CMSC 132 taught by Professor Padua-perez during the Fall '08 term at Maryland.

Page1 / 4

(24) Object Oriented Design - Applying object-oriented...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online