[an error occurred while processing this directive]

cs205 Friday 22 September 2006

Upcoming Schedule

Array Subtyping

public class SubType {
   static public void setLast (Object [] arg, Object val) {
      // REQUIRES: arg has at least one elements
      // MODIFIES: this
      // EFFECTS: Sets the last element of arg to val.
      arg[arg.length - 1] = val;
   }

   public static void main(String[] args) {
      String [] sarray = new String [2];
      setLast (sarray, new String ("Hello"));
      System.out.println ("val: " + sarray[1]);
      setLast (sarray, new Object ());
      System.out.println ("val: " + sarray[1]);
   }
}
If ST, should S[]T[]?








Design

What does it mean for a design to be good?

What should a design document document?












Modular Dependency Diagrams

If the specification of M changes, then all modules that depend on M need to be reconsidered.

Is this a good design?







How is a taste in this beautiful art to be formed in our countrymen, unless we avail ourselves of every occasion when public buildings are to be erected, of presenting to them models for their study and imitation?...You see, I am an enthusiast on the subject of the arts. But it is an enthusiasm of which I am not ashamed, as its object is to improve the taste of my countrymen, to increase their reputation, to reconcile them to the rest of the world, and procure them its praise.
Thomas Jefferson (letter to James Madison, 1785)