CS 5010: Module 09
In this module, we will see how everything we've learned so far can be ported to an object-oriented context. We'll see how:
- objects correspond to structs
- classes correspond to define-structs, and
- interfaces correspond to data definitions.
We'll see how a functional orientation and an object orientation are just two ways of looking at the same definitions.
Then we'll consider some of the subtleties of testing in an object-oriented setting.
We'll summarize by rewriting the Design Recipe for an object-oriented setting, and see how our deliverables should appear in your program.
No required readings.
Most of you know Java well enough to have considered using it for Problem Set 00.
Those of you who don't know Java need to learn it in a hurry. The tutorial resources listed below are designed to teach you what you need to know about Java.
We will test your Java programs using JDK 8 on a Linux machine or Macintosh. That means you may need to install JDK 8 on the machine you use for writing your CS 5010 programs, so you can test your programs using the same version of Java we will be using to test your programs. (If you are using a Linux machine, Java is probably already installed. If you are using a Macintosh, you probably installed Java at the beginning of the semester when you installed the XCode Command Line Tools. If you are using a Windows machine, you will probably have to install Java yourself.)
If you are unable to install JDK 8 on the machine you have
been using for writing programs, you can test your programs
We recommend the following tutorials, especially if you do not feel comfortable programming in Java or do not know how to invoke the Java compiler and runtime system from a Linux command line.
- "Hello World!" for Solaris OS and Linux
- Lesson: A Closer Look at the "Hello World!" Application
- Questions and Exercises: Getting Started
- Lesson: Common Problems (and Their Solutions)
Trail: Learning the Java Language
(You can use this as a reference manual for the Java language. The real reference manuals for Java are far more detailed, and tell you more than you need to know for this course.)
- Lesson 9.1: Classes, Objects, and Methods
- Lesson 9.2: Case Study: Universal Coordinated Time (UTC)
- Lesson 9.3: Functions vs Classes
- Lesson 9.4: Equality
- Lesson 9.5: Static Methods
- Lesson 9.6: Testing Simple Objects
- Lesson 9.7: Design Recipe Using Classes
Problem Set 09 was assigned on Monday, 20 March.