SDSU CS 635 Advanced Object-Oriented Design & Programming
Spring Semester, 2002
Assignment 4
    Assignment Index        
© 2002, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 26-Feb-02

Assignment 4

Due March 7

The goal of this assignment is to implement the Strategy pattern. Given the size of this assignment the use of the Strategy pattern may not be reasonable here. There may be shorter, more reasonable solutions to this assignment, but they will not allow us to study the Strategy pattern.

1. We are going to create a collection class called List. This collection class will contain integers. The algorithm that will change is how the list is ordered. One ordering is sorted, another is reverse sorted and a third is ordered added to the list. The list class needs a method to add elements. Since the list keeps it own order it does not make sense to allow the clients to add elements at a particular location. Clients need to be able to access elements at specified locations in the list. You can add more methods if you like.

Notes. Since the algorithm in the list is so small some will be tempted to not use the strategy pattern or greatly modify it. For example Smalltalkers may be tempted to use blocks, which normally would make sense to solve this problem. By passing the pattern will have some negative consequences. First you will lose points. Second, I will not give simple assignments in the future. Third, you will miss the value of the assignment.

Grading


Percent of Grade
Working Code
10%
Unit Tests
15%
Quality of Code
25%
Proper implementation of Pattern
50%




Copyright ©, All rights reserved.
2002 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.

    visitors since 26-Feb-02