25ObjectOrientedDesignSEV

25ObjectOrientedDesignSEV - CMSC 132: Object-Oriented...

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

View Full Document Right Arrow Icon
CMSC 132: Object-Oriented Programming II Object-Oriented Design Department of Computer Science University of Maryland, College Park
Background image of page 1

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

View Full DocumentRight Arrow Icon
Applying Object-Oriented Design 1. Look at objects participating in system Find nouns in problem statement (requirements & specifications) Noun may represent class needed in design Relationships (e.g., “has” or “belongs to”) may represent fields 2. Look at interactions between objects Find verbs in problem statement Verb may represent message between objects 3. Design classes accordingly Determine relationship between classes Find state & methods needed for each class
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
1) Finding Classes Thermostat uses dial setting to control a heater to maintain constant temperature in room Nouns Thermostat Dial setting Heater Temperature Room
Background image of page 4
Analyze each noun Does noun represent class needed in design? Noun may be outside system
Background image of page 5

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

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

Page1 / 20

25ObjectOrientedDesignSEV - CMSC 132: Object-Oriented...

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

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