Official summary:
The course presents the theory and practice of object-oriented
programming.
The course enhances students understanding of the concepts of object,
class,
message, method, inheritance, and genericity. The course covers a
basic
model for objects; the principles of types and polymorphism in
object-oriented
programming languages; different forms of abstraction; and theory and
practice
of reuse. The course also introduces students to some object-oriented
design
patterns that practitioners have found useful.
Announcements
Wed, 21 Apr 2010: Here is my updated final exam information. First, from the registrar's
office, the exam is Monday, April 26th, 8:00-10:00, in Robinson
Hall 409. The format of the final will be that of the midterm, so
half "theoretical" questions and half "practical" questions. Just
like the midterm, you have the right to a double-sided 8.5"x11"
cheat sheet. Other than that, closed books and closed notes and
closed computers.
Wed, 21 Apr 2010: Here are the Submission Instructions for Homework 6 --
(1) Write a README text file giving your team members, and describing
the extensions to the game you have made: what extensions you
made, what classes you added,
interesting bits about implementation of those classes, even a
sample execution of the game showcasing your extensions to the
game.
(2) Zip up all the source code of your game, as well as your
README file, into a file called homework6.zip. The idea
is that I should be able to compile your whole game using your
submitted file, without messing with it.
(3) Go to the submission site and submit your zip file. Only one
submission per team is necessary.
Tue, 20 Apr 2010: Here is
the final
review list from this morning's lecture. This morning, I also
talked about abstracting control-flow, and gave a
continuations-based example in Scheme. Here is an interesting and
short article that
highlights continuations in Scheme and shows how to use them to implement other control-flow mechanisms, such as exceptions, and time-traveling search, among others. I mentioned that continuations were useful to understand web programs; the following article gives a sense of what I mean. For the more technically inclined, you may find the following article interesting.
Fri, 16 Apr 2010: Here is a link to a decent
Python tutorial.
I've uploaded the code from this morning's
lecture, List.py,
as well as
a sample
session with the code, a bit different in the details from
what I did this morning, but similar in spirit.
Fri, 09 Apr 2010: Lecture notes for this morning's lecture on the Model-View-Controller
design pattern are now
available.
I also provided the
source
code for the lecture.
Tue, 06 Apr 2010: I'm canceling class and office hourse today, seeing I lost my voice
because of a cold. I'll hold make-up office hours this Friday,
15h00-17h00.
Mon, 05 Apr 2010: A quick look at Banner seems to indicate the following time for our
final exam:
8:00am - 10:00am M Apr 26, 2010 .
Sun, 04 Apr 2010: A bit late because of the flu, but homework 6 is
up. Due Sunday, April 25th. There is a lot
of support
code for this one.
Sat, 03 Apr 2010: Lecture notes for Friday's lecture on the Publish-Subscribe design pattern
are
now
available.
I also provided the
source
code for the lecture.
Wed, 31 Mar 2010: Notes for Tuesday's lecture on the interaction of subclassing and
mutation
are now
available.
Fri, 26 Mar 2010: Notes for this morning's lecture on adapters
are now
available.
Thu, 25 Mar 2010: In the specification of MovieB in Question 3, the signature
of the numberFrames() method should indicate it returns
an Option<Integer>, and not an int. The
code gets this right.
Tue, 23 Mar 2010: Lecture notes for this morning's lecture on mutation
are now
up.
Tue, 23 Mar 2010: A student just pointed out to me that my description of behaviors is
missing something important. Intuitively, the scale(str) behavior
takes a streams str of floats and produces (via an iterator) a sequence of
transformations that scale a frame around its center by the specified
ratio, using the scale() operation on frames. The
rotate(str) behavior takes a stream str of floats and produces a
sequence of transformations that rotate a frame around its
center by the specified
degrees, using the rotate() operation on frames. I've updated
the homework
write-up.
Tue, 23 Mar 2010: Here are a couple of sample files for testing your homework 5
code. First, to try out your MFrameB implementation, here's
TestMFrameB.java,
that has a couple of sample frames to try out your translate, rotate,
and scale functions, independently, and all together. Pick one of the
four tests (comment out the others, only the last one will actually show), and try it out. Here are the
outputs that testTranslate(), testRotate(),
testScale(), and testAll create, respectively:
To try out your behaviors and movies, use
TestMovieB.java,
which constructs three behaviors (a cross movement behavior, a spinning-in-place
behavior, and a smaller-then-bigger behavior) and applies them to the
boy sprite. Again, there are four tests available, choose one and
comment the others. (Otherwise, only the first one will actually run.)
Sat, 20 Mar 2010: Lecture notes for Friday's lecture on multiple inheritance and ADT
extension
are now
up.
Let me know if anything is amiss.
Mon, 17 Mar 2010: Homework 5 is
up. Due Friday, March 26th. There are a bunch
of support
files available for
this homework.
Tue, 16 Mar 2010: In case you're waiting with bated breath, I'm still hacking on
homework 5, and I expect to get it out tomorrow morning.
Tue, 16 Mar 2010: Lecture notes for this morning's lecture on inheritance and delegation
are now
up.
They're a bit rough around the edges, so let me know if anything
doesn't actually make sense in there.
Fri, 12 Mar 2010: Lecture notes for this morning's lecture on laziness
are
now
up.
I also provided the
source
code for the lecture.
Fri, 12 Mar 2010: A couple of comments about homework 4, due tonight. First off, some
people spotted the fact that the specification
for Overlay(m1,m2).funcIterator().moveToNext() in Question 3 is
missing. Indeed. Oversight on my part. Here's
what moveToNext() should do: it should move both of the
underyling iterators for m1 and m2 to the next
element, leaving either one unmoved if it's out of elements.
Second, the implementation of equals() for Question 1 is
headachy because Option is a polymorphic class. Rather than
having you figure it out yourself, here is the implementation
of equals() for both concrete subclasses
of Option. For none():
public boolean equals (Object obj) {
if (obj instanceof Option) {
@SuppressWarnings("unchecked")
Option