Design Patterns Lab
The objective of this lab is to understand some of the fundamentals of
an important software technique known as design patterns. The
content of the lab is authored by Professor Wahls, and we will be
using the description he provided for a previous instance of the
Senior Seminar, available from the following link:
There are a few minor differences between Professor Wahls' description, and the way the lab will operate in our own class. The differences are:
- You must work in the randomly-chosen pairs announced in class.
- To submit your work, please submit to Moodle a single ZIP file
of the .java files in the cardealership folder.
- You are not required to document your code in this lab. The code
will be graded on correctness and elegance of design only.
- A small amount of extra credit is available for a written answer to the following question:
- The visitor pattern, as described in this lab, applies to
any set of classes, including classes that are not related by
inheritance. If, on the other hand, the set of classes we may
wish to visit all inherit from a common superclass or interface
to which we can make changes, the visitor pattern can be
simplified somewhat. Write a few paragraphs describing how you
can simplify the pattern in this case, including some example
code to clarify your explanation if necessary. (Hint: fewer
code changes are required, and you will need to use
Java's instanceof keyword.)
If you attempt this extra credit question, put your written answer
in a separate file (.txt, .pdf, .docx, or any other easily
readable format) and submit it to Moodle in the same ZIP file as
your code. Do not submit an altered version of your code.