“Still Life with Fruit” Design

CSc432: Object‑Oriented Software Engineering

 

An artist wants some software to represent objects he might manipulate in still life paintings.  For our prototype, we want to design a system of classes that manipulate different kinds of fruit in a bowl.  Fruit generally have the following attributes of interest: they have a color, a shape, and a center located in two‑dimensional space. To keep the prototype simple, colors will simply be strings, and shapes will be simple geometric attributes for different kinds of fruit. The artist wants to be able to manipulate these attributes: changing colors, growing or shrinking shapes, moving centers.  However, different kinds of fruit have different default colors and shapes. Apples are (by default) red and 2" in diameter, bananas are yellow and 6" in length, grapes are purple and come in clusters, in which each grape is 1" in diameter.  When an apple changes shape, its diameter grows or shrinks by some specified amount, but bananas grow longer or shorter, and grapes add or remove a subcluster (some number) of grapes to the main cluster. Finally, a bowl is a collection of fruit, to which the artist may add or remove individual fruit (apples, bananas and grapes), as well as print out the collection with their current attributes. For the prototype, we will defer most user interface concerns; all operations will be demonstrated by a simulated artist (a driver class). 

 

Given the UML class and sequence diagrams you have already created for this analysis of this problem, flesh out a design of this problem as a set of abstract data types (ADTs).  For guidance about how to construct ADTs, you may consult chapters 3 and 8 of Thomas and Weedon’s Object-Oriented Programming in Eiffel (on reserve at the library), the handout  I gave  you from this textbook, my version of the Employee ADT at http://www.cse.lehigh.edu/~glennb/oose/employee.ADT.doc, and the CIMEL multimedia unit on abstract data types, available at http://cimel.cse.lehigh.edu.

 

Again, for the purpose of the CIMEL project evaluation, students in group B (who have not seen the multimedia yet) should complete the assignment once before going through the multimedia.  After submitting the first version, students in group B may make changes and resubmit the assignment.  Students in group A may also resubmit the assignment, after waiting one day after submitting the first version.   If you decide not to resubmit with any changes, you should send me an e-mail indicating that you will not resubmit.  After completing the task (submitting and resubmitting any improvements), students in both groups should take the objective post-test, at http://lens.eecs.lehigh.edu/gblank. Thanks!

 

Hand in: a set of ADTs for the Fruit problem, preferably as a Word document.

 

Due: Friday, March 3.