University of Virginia, Department of Computer Science
CS201J: Engineering Software, Fall 2002

Notes: Thursday 3 October 2002
Schedule

Exam 1
Exam 1 will now be handed out on October 10 and due on October 15. It will cover everything in the course so far, up to (but not including) today. The exam is take home and open book, but you will not be permitted to use other humans or a Java compiler for the exam (unless you write your own).

You should not be surprised if the exam contains questions about specifying procedures, data abstraction, specifying data abstractions, implementing data abstractions (including choosing good representations, rep invariants and abstraction functions), static analysis, testing, design and Java semantics. You may need to write some code snippets to answer exam questions.

The recommended ways to study for the exam are:

  1. Go over the problem sets and make sure you understand the comments.
  2. Look over the notes and answer the questions on the notes.
  3. Practice designing and implementing data abstractions (in particular, you may want to develop the Nodes and Matrix representation of Graph from Lecture 7)
  4. Re-read sections from the book
Notes
Subtyping
B is a subtype of A means wherever an object of type A isexpected, we can use an object of type B instead.

Object is the ultimate supertype of every object type in Java.

Inheritance
Reuse the implementation of the supertype to implement a subtype.

class B extends A means:

class C implements I means:
Should a type be permitted to have more than one subtype?





Should a type be permitted to have more than one supertype?





Should a class be permitted to inherit from more than one class?





Apparent and Actual Types

Apparent types are associated with declarations: they never change
Actual types are associated with object: they are always a subtype of the apparent type

Compiler does type checking using apparent type.
Virtual Machine does method dispatch using actual type.

Can the apparent type of an array element ever change?




How can you change the actual type of a variable?



Java and C++ make you think that the new ideas are like the old ones.
Java is the most distressing thing to hit computing since MS-DOS.

Alan Kay

Don't worry about what anybody else is going to do. The best way to predict the future is to invent it.
Really smart people with reasonable funding can do just about anything that doesn't violate too many of Newton's Laws!

Alan Kay

And they showed me really three things. But I was so blinded by the first one I didn't even really see the other two. One of the things they showed me was object oriented programming they showed me that but I didn't even see that. The other one they showed me was a networked computer system...they had over a hundred Alto computers all networked using email etc., etc., I didn't even see that. I was so blinded by the first thing they showed me which was the graphical user interface. I thought it was the best thing I'd ever seen in my life. Now remember it was very flawed, what we saw was incomplete, they'd done a bunch of things wrong. But we didn't know that at the time but still though they had the germ of the idea was there and they'd done it very well and within you know ten minutes it was obvious to me that all computers would work like this some day.
Steve Jobs (on seeing a Smalltalk demo on his 1979 visit to Xerox PARC)


CS201J University of Virginia
Department of Computer Science
CS 201J: Engineering Software
Sponsored by the
National Science Foundation
cs201j-staff@cs.virginia.edu