Activity 4-2 Design Case Study

In this case we will think through a small design problem and build the main structure of a small application.

Setup

You are hired by the registrar’s office of a certain college to create a record-keeping application for the college. Here is a description of its features:

Our task for today will be to design some of the classes and interfaces that would support this functionality.

First steps

We start by considering a class that represents a term, we’ll call it Term.

  1. What data fields might this Term class contain? What are their types?
  2. Do we need any other classes in order to be able to define the Term class?
  3. What public methods might the Term class have?
  4. Is your class handling limits on how many units a student can take in a semester and what the limit for “full-time” is, or will these happen somewhere else?

Now we consider a class to represent a particular course offering, we’ll call it Section.

  1. What data fields might this Section class contain? What are their types?
  2. Do we need any other classes in order to be able to define the Section class?
  3. What public methods might the Section class have?

Now we consider a class to represent a student, we’ll call it Student.

  1. What data fields might this Student class contain? What are their types?
  2. Do we need any other classes in order to be able to define the Student class?
  3. What public methods might the Student class have?

Now we want to somehow represent the act of a student taking a specific class. We’ll represent this with an Enrollment class.

  1. What data fields might this Enrollment class contain? What are their types?
  2. Do we need any other classes in order to be able to define the Enrollment class?
  3. What public methods might the Enrollment class have?

Imagine we also have a class that represents our connection to the database. We’ll call it Database.

  1. What data fields might this Database class contain? What are their types?
  2. Do we need any other classes in order to be able to define the Database class?
  3. What public methods might the Database class have?
  4. Should this actually be an interface instead of a class?

Now we want classes to represent the various requests that might come to our system.

  1. What are all the different requests that might come?
  2. What pieces of information does each request need to hold?
  3. Is there any common behavior that all these requests share?

What other classes would we need in our system?