Lectures
In this section, you’ll find brief notes from each lecture. For more detailed notes, please see the book.
1 1/6: Objects
- Announcements
Course staff introductions.
Basic class mechanics.
On the experimental nature of this course.
The first assignment is due this Wednesday.
The first lab is tonight.
Partners will be assigned in lab.
Questions?
- Basics of objects
New paradigm. Open your mind and embrace it (or you will be miserable).
Rocket, designed in functional style.
Rocket, designed in object-oriented style.
Landing and take off.
Moon.
If you don’t have a CCIS account, you need to get one TODAY.
2 1/9: Data definitions and functionality with classes
Defining simple composite classes, examples of enumerations and unions, making the rocket land and take off; adding a satellite and animating bouncing balls.
3 1/13: Interfaces
An interface is what an object does, not what an object is. Worked throgh Mobile example, as a data definition, and tried to define balanced.
4 1/16: PacMan
Working on methods that require structurally-recursive helper methods (such as Mobile’s width). Began designing a PacMan game: data representations, the beginning of rendering, and the need for accumulator parameters.
5 1/20: No Class
MLK Day
6 1/23: Delegation, Parameterized Data Definitions, PacMan II
Extracting common position-related methods to a posn% class, including clamping a position to the game boundaries (as opposed to wrapping around from one side to the other). Abstracting away from ILoNumber and ILoGhost to [List T], and parameterizing the methods that go along with that data type.
7 1/27: Invariants and random testing
Introduction of invariants as “information about the data beyond what the type tells you”. Using and defining invariants to maintain a sorted list of numbers and a sorted tree of numbers.
8 1/30: Review and Inheritance I
Recap of classes, interfaces, methods and delegation. Introduction of inheritance as another mechanism for code reuse.
9 2/3: Universe and protocols and invariants
Introducing the object-oriented Universe system for communicating between worlds. Introduce client/server programming and the need for message protocols. Understand that protocols require enforcing an invariant to ensure that messages arrive in an expected pattern. Also recognize that the error-checking needed for malformed messages is almost identical to the errors obtained when calling a method incorrectly, and that there is a close parallel between sending a message between worlds and sending a message to an object.
10 2/6: Inheritance and Constructors
11 2/10: In-class Exam 1
12 2/13: Java I: Syntax and Semantics
13 2/17: Holiday (Presidents Day)
There is no lecture on 2/17 since it is Presidents Day.
14 2/20: Java II: Types, Constructors and equality
15 2/24: Function Objects and Generics
Boston Marathon examples of filter and fold-like questions, as a motivation for generic IRunnerPredicate function objects. Then generalizing them to IFun<S ,T>, and implementing map on a general-purpose IList<T>.
16 2/27: Review of Generics, Binary Trees and Visitors
17 3/3: Holiday (Spring Break)
There is no lecture on 3/3 since it is during Spring break.
18 3/6: Holiday (Spring Break)
There is no lecture on 3/6 since it is during Spring break.
19 3/10: Mutation I
20 3/13: Mutation II
Counters, setting the nth item of a list, union-find, more aliasing.
21 3/17: Array Lists and Loops
ArrayList<T> as a built-in example of IMutableList<T>, working with for and for-each loops, and implementing in-place selection sorting of ArrayList<T>s.
22 3/20: Equality, Redux
Finishing in-place selection sorting of ArrayList<T>s; dictionaries, equals and hashCode; exam review
23 3/24: In-class Exam 2
24 3/27: While loops, Iterators and Iterables
We defined while loops, and simplified for loops into equivalent while loops. We also defined the Iterable<T> and Iterator<T> interfaces, that together express the ability to be used with a for-each loop. We defined an Iterator for ArrayLists that used an integer index to keep track of the current item, another Iterator for Deques that kept track of the current Node, and finally an in-order Iterator for binary trees that had to keep track of a whole stack of the nodes remaining to be iterated over.
25 3/31: Big-O notation
Selection sort, insertion sort, merge sort, and the beginnings of heap sort. Examined worst and best case behaviors of algorithms