The Department of Computer Science & Engineering
cse@buffalo
STUART C. SHAPIRO: CSE 115 C

CSE 115
Introduction To Computer Science for Majors I
Lecture C
Lecture Notes #4
Stuart C. Shapiro
Spring, 2007


Introducing Object Oriented Programming

The Design and Implementation Process
  1. Conceptualize what you want to be done. (Conceptual Model)
    The O-O Approach: Think of it as a system of interacting objects.
  2. Refine the conceptual model---start filling in details.
  3. Filled-in details become expressed in Java.
    Use UML (Unified Modeling Language), Eclipse, Green, etc.
  4. Test, debug.
  5. Continue refining, reorganizing, testing, debugging, etc.
Compare: designing and building an entertainment center given materials and tools; think first about the design, not about the tools.
See text examples of domains and analyzing them

Objects
An object has

Properties vs. property values
  • Height vs. 6'2''
  • Color vs. red
  • "Colorless green ideas sleep furiously." [Chomsky, 1957]

Object Classes vs. Object Instances
We'll spend most program design time on designing object classes.
Object classes will have properties and capabilities.
Object classes will have relationships with each other.

Object instances will usually be created at run time,
and will have capabilities, properties, property values, and relationships with other object instances.

An object instance is an "object".
An object class is a "class".

On-Line Demonstration and Examination of Java Code
  1. The UB and CSE networks
  2. Eclipse
  3. Perspectives and views
  4. DrJava
  5. Expressions and statements
  6. Parentheses: grouping and arguments
  7. Creating an object (an instance of a class)
  8. Using Green to write a class definition
  9. Examining the code of Dog.java

First Previous Next

Copyright © 2001, 2007 by Stuart C. Shapiro. All rights reserved.

Last modified: Wed Sep 19 10:47:47 EDT 2007
Stuart C. Shapiro <shapiro@cse.buffalo.edu>