CISC 3115

Unit 1 Reading Guide

Learning Targets

In each Reading Guide, I will provide a list of "learning targets" which tell you the most important skills and concepts I want you to get out of each unit. In general, the questions I ask on tests, exams, and application activities will be oriented toward either helping you acquire these skills and concepts or assessing your mastery of them. Some units will have more learning targets than others!

Learning Targets 1–3 may be review for you (they're discussed in chapters 1 and 3), but they're essential for a strong start in this course.

  1. I can explain the motivation and structure of Java's "virtual machine" approach.
  2. I can distinguish among objects, references, and primitive values.
  3. I can explain the relationship between objects and classes.
  4. I can explain some of the advantages of object-oriented design and programming.
  5. I can write a simple class definition, as well as code that uses that definition.

Depending on your previous experience with Java, you may be quite comfortable with the concepts of "object" and "class," and you may have some idea of what "object-oriented programming" is. Or you may not!! I do not assume that you have much experience with these ideas—though I hope you have heard before that Java is an "object-oriented programming language." I also hope that you know that you have used objects before—for example, when we write System.out.println("Hello, world"), we are invoking (or calling) the println method of the object that System.out refers to.

Chapter 2 of the textbook is based on similar hopes—you've heard about objects, but maybe you're not sure what the difference is between "object-oriented programming" and what you learned in CISC 1115. The Chapter is mainly trying to "sell" the idea of object-oriented programming as an approach that makes it easier to write "good" code. What does "good" mean? The story on pp. 28–33 illustrates some aspects of "good" code, and it illustrates some of the differences between "procedural" programming (which is what a lot of us are taught at first) and object-oriented programming. As you read the story, focus on the reasons why Larry keeps on being nervous, but Brad is always calm.

One of the differences between Brad's and Larry's code is that it looks like Brad is writing a lot more code, at least at first. But be sure you look closely at the diagram on p. 30. I don't expect you yet to have a clear idea of what "inheritance," "superclass," and "subclass" mean, but spend some time thinking about the advantages of the structure shown in this diagram and on p. 31. What do "abstract" and "specific" mean in the context of these diagrams?

The discussion on p. 34 should include words that are familiar to you—object, method, instance variable. Probably, you've used these words before when talking about how to use objects; this discussion is starting to talk about how to design objects. It uses concepts you already have some handle on, but now from a different point of view. (And designing objects is definitely a main focus for us this semester.)

One important aspect of this book is its emphasis on learning by doing. It gives you plenty of exercises, but you should add exercises for yourself. For example, type in and run the little Dog and Movie programs on pp. 36–37. This is good practice for getting used to vim and using javac and java. It also gives you some practice writing class definitions.

Similarly, carefully review the code for the guessing game on pp. 38–40. If you like, you can either type it in, or download the sample code from the book's website. If you're using vim, I recommend deleting the first line from each source file ("package chap02") for now, as it makes things a little complicated at this stage. Once you've done that, you should be able to say javac GameLauncher.java to compile (the compiler will automatically "find the other Java files it needs) and then java GameLauncher to run.

Review the "Bullet Points" on p. 41, then do as many of the exercises, up through p. 45, as you have time for—these are really important for reinforcing the concepts of the chapter. And you may see some of these exercises on the RAT.