Wednesday, March 26, 2008

Project 3c

Due Date: Monday, 28 April (firm!)

Team project

Objectives

An understanding of

Description

In this project, you will refactor your implementation of the simple API for drawing graphical shapes from project 3b. Then you will describe your experience in a brief report.

Refactoring part (60%)

Your job is to perform the following refactorings on your (possibly revised) project 3b submission:
  • Encapsulate the Shapes classes with/inside an Abstract Factory.
  • Replace instance methods with a Visitor:
    • Introduce a ShapesVisitor interface with visitation methods for all Shape variants.
    • Replace the size, getBoundingBox, draw, and fill methods in the Shape interface and all implementing classes with an accept method for the visitor.
    • Create visitor implementations that provide the functionality of these four methods.

You should proceed in very well thought-out, small steps in such a way that you preserve the correctness of your code with respect to the unit tests. At some points in this process, however, you will have to refactor the tests themselves to keep them consistent with your code.

Writing part (40%)

  • Study the references provided above for code smells and refactorings.
  • (10%) Describe the refactoring steps you performed in detail.
  • (5%) Compare the code before and after the refactorings (which is easier to understand? easier to modify?)
  • (5%) Discuss briefly whether or not the Eclipse refactoring tools helped with this activity.
  • (5%) Evaluate your experience with this refactoring activity, including the team experience and the process of refactoring existing functionality.
  • (5%) Identify any other code smells that are still present in project 3c and suggest specific refactorings that should be applied to remove the smells.
  • (5%) Discuss whether there is any tension between the two refactorings, given that the visitor pattern enables a client to add its own operations on a composite.
  • (5%) Be sure to write effectively, following the general guidelines and the theoretical or practice article form from this resource. Your work is evaluated based not on length, but on accuracy, conciseness, and style. You should aim for a total of two to three pages.

How to submit

Please refer to the online submission procedure. Each team is to make exactly one submission. The written paper must be submitted either as a PDF document or through Google Docs.

No comments: