Design Patterns in OO Programming
Fall, 2010

CIS 4930
Announcements

 
Last updated Fri Dec 3 2010 at 19:56:00 EST
Dec 3 at 19:55

The exam is in the same room as it has been all semester (as per the syllabus); the announcement below was an incompletely edited cut-and-paste job. It lies.

Dec 1 at 19:58

Upcoming events

Friday, 12/3, 8:20-10:10pm
Exam 3 in CSE E119
Monday, 12/6, 5:10-10:30pm
In honor of the presentations there will be no lecture
Term project paper & hard copy of presentation visuals (one per team) due
Term project presentations in FLG 0265
Tuesday, 12/7, 5:10-10:30pm
Mandatory postmortems (individual) due
Term project presentations in CSE E221
Wednesday, 12/8, regularly scheduled lecture period
Grades, discussion and course evaluations

Regarding the papers/postmortems

For what it's worth, I loathe double-spaced papers—quad-spaced is the only way to do it. But seriously: I like single-spaced, 12pt. font.

Random e-mail response

 
> thinking about using and XML-based markup
 
That's fine... 
 
but seriously: WHY?  Because it's trendy?  Or do you have a GOOD
reason for wanting to use it?
 
XML: When to use it and when not to use it 
Soapbox: Humans should not have to grok XML (Answers to the question "When shouldn't you use XML?") 
Nov 29 at 12:39

Notes

For those of you unable to attend class last wednesday, here are the lecture 39 notes.

Nov 16 at 16:17

Term Project

Design a level editor for an action/RPG-oriented game engine.

Nov 13 at 09:56

FYI: what it means to be first class.

Nov 10 at 14:12

Homework

Answer these questions (be sure to justify your responses!) based on this diagram from lecture...

Nov 9 at 22:23

Read

Oct 25 at 12:53

Homework: due Wednesday

Arithermetic Expression Trees and Visitors

Oct 20 at 10:03

Microsoft's annual College Puzzle Challenge will be held on Saturday, November 6th. Team registration is open. It's a fun event, hosted by Gator grads!

Oct 18 at 07:52

Be prepared to explain what happens when the preorder iterator code from the text is hand executed today in class. You will be called on.

Oct 7 at 12:32

Apparently Oracle is incompetent: while they are still maintaining an index to the old JDC Tech Tips, the links no longer work. However, the good old Wayback Machine comes through again... Using the Varargs Language Feature and Covariant Parameter Types.

Oct 6 at 13:42

HW: due Friday

Write the code necessary to maintain the invariant that a Component has-a parent when added to a Composite structure and lacks a parent when removed from the structure. i.e., "If I think you are my child, you think I am your parent." Hint: use one of the patterns we've already discussed

Implement at least:

All classes shall have a toString() that recursively prints a PREorder traversal [self first, then kids]

Hand build a compsite and call toString() on it

A simple example

lc = new LinkedComposite( new Leaf( "A" ), new Leaf( "B" ) ); 
ac = new ArrayComposite( new Leaf( "C" ), lc, new Leaf( "D" ) );
ac.toString();

Would output (note the indentation)

ArrayComposite containing 
   Leaf C 
   LinkedComposite containing 
      Leaf A
      Leaf B 
   Leaf D

In case you weren't ware of this bit of magic... Using the Varargs Language Feature and Covariant Parameter Types. And yes you do need to implement add()/remove().

Clarification

As you know, arrays have a fixed size while linked lists do not. By that logic, an array based Composite may have up to, but no more than its maximum number of children (which would be defined when it is created).

And finally...

For the HW, you are to write your own linked list class!

Sep 27 at 17:00

FYI: I curently can read, but not reply to email. I've spoken to the sysadmins and hope to have the situation fixed sometime tomorrow.

Sep 26 at 21:26

Please bring at least one blue pen or black pen with which to record your answers on today's and future exams. The requirement, of course, refers only to the exterior of the pen: its ink must be some shade of invisible-except-under-UV-light. ;)

Sep 20 at 10:06

The exam dates are now confirmed. The syllabus has been updated with locations and times.

Sep 13 at 07:58

Homework #3: due Wednesday

Implement a base class Magnitude; instance can be compared to each other. It shall, support the comparison operations:

Note: don't add any other methods to the base class Magnitude; they aren't necessary and probably will defeat the purpose of the assignment.

 

To prove the correctness of your implementation, you shall implement two subclasses [the only operation that your subclasses are allowed to override is lessThan()]:

Currency — represents money
the magnitudes being compared are currency amounts (doubles)
CartPoint — represents points on the Cartesian plane
the magnitudes being compared are distances from the origin (double)

 

and driver programs to make it all go. Deliverables: standard stuff + source + output.

 

Note 2: Magnitude is meant to implement an inheritable functionality, NOT a define a type (with multiple implementations). The methods are meant to compare magnitudes of the same class: comparing CartPoint to Currency is nonsense.

 

HW #4: due Wednesday

As you may know, the sort() method from Java's Collections class — which takes an appropriate Comparator object for the type of data in the collection — performs a merge sort. The Java Design Patterns Workbook claims that because one step of the merge sort algorithm is being customized using a Comparator, that it is an example of Template Method. What do you think? Justify your answer. [200,400] words.

Aug 23 at 18:19

Read

Riehle & Züllighoven's Understanding and Using Patterns in Software Development

Aug 22 at 14:31

Welcome to Design Patterns in Object-Oriented Programming! Be sure to check this page at least once a day so you don't miss any important announcements.

The mandatory biosketch assignment is due at the start of lecture on Friday 8/27. If you've written one previously, you can simply resubmit it with an updated “why you are taking this course” section, or even better, take the opportunity to tell me something new about yourself. (Should you be interested in such things, Dave: fact or fiction? is available for your reading pleasure.)

This website is an original work, Copyright © 2010 by Dave Small. All rights reserved.