Example: Class Relationship Diagrams (Domain Model)

Steven Zeil

Last modified: Feb 21, 2019
Contents:

1 Continuing with our Domain Model

First, a quick recap:

1.1 Problem Statement

ODU offers a number of courses via the internet. A common requirement among these courses is for a system of online assessment. An assessment is any form of graded question-and-answer activity. Examples include exams, quizzes, exercises, and self-assessments. In preparation for automating such a system, our group has undertaken a study of assessment techniques in traditional classrooms.

An assessment can contain a number of questions. Questions come in many forms, including true/false, single-choice from among multiple alternatives, multiple choices, fill-in-the-blank, and essay. There may be other forms as well.

Students take assessments that are administered by instructors. The students’ responses to each question are collected by the instructor, who grades them by comparison to a rubric for each question. The instructor may also elect to provide feedback (written comments), particularly about incorrect responses.

A total score for the assessment is computed by the instructor. If this is a self-assessment, the score is for informational purposes only. For other kinds of assessments, the instructor records the score in his/her grade book.

Information is returned to the student about their performance. At a minimum, the student would learn of their score and any instructor-provided feedback. Depending upon the instructor, students may also receive the questions, a copy of their own responses, and the instructor’s correct answer.

1.2 Where We Ended Up

So far, we have diagrammed a number of classes, adding attributes and operations to a number of them:

Assessment
: seq of Question

GradeBook

record(score, for: Student, on: Assessment)
GradedQuestionResponse?
score
feedback

GradedResponse?
overall score : seq of GradedQuestionResponses
computeTotalScore(): score
Instructor
: GradeBook
administer(: Assessment, to: seq Student)
Question
: Rubric

QuestionResponse?
responseTo: Question
grade(Rubric): GradedQuestionResponse
Response
: seq of QuestionReponses?
: seq of Rubric?
gradeAllQuestionResponses()
Rubric

grade(QuestionResponse?): GradedQuestionResponse
Student

take(:Assessment): Response
receive(: GradedResponse)

We also had a handful of classes that we set aside in our first pass as variants of a more general case that we were looking at in detail:

Exam


Quiz


Exercise


Self-Assessment


True/False Question


Single-Choice Question


Multiple Choices Question


Fill-In-The-Blank Question


Essay Question


2 What Isn’t Captured in Our Class Descriptions?

Let’s look for things that we learned but that the CRC cards don’t really capture.

2.1 Different Kinds of Assessment

ODU offers a number of courses via the internet. A common requirement among these courses is for a system of online assessment. An assessment is any form of graded question-and-answer activity. Examples include exams, quizzes, exercises, and self-assessments. In preparation for automating such a system, our group has undertaken a study of assessment techniques in traditional classrooms.

These two sentences tell us two things about assessments.

  1. There is some content inside each assessment.

    Arguably, we have already started to represent some of that as attributes of the Assessment:
    Assessment
    : seq of Question

    We could also show this in a more visually intensive fashion as follows.

    (Note the ’*’ indicating the multiplicity, 0 or more, indicating how many questions can be in an assessment.)

  2. There are many variations on the idea of assessment.

    We don’t yet have an explanation of why these variants exist, or how their attributes and behaviors might differ, but we know that the concept of these varying kinds of assessments was important enough to be mentioned even in this quick overview.

    Nonetheless, this suggests a generalization relationship.

 

2.2 Different Kinds of Question

An assessment can contain a number of questions. Questions come in many forms, including true/false, single-choice from among multiple alternatives, multiple choices, fill-in-the-blank, and essay. There may be other forms as well.

Suggests another generalization relationship.

 

The two generalization relationships that we have shown here are good examples of things hat are not captured at all by diagramming classes in isolation with one another.

Similarly, if we had used CRC cards to collect our candidate class information, these relationships would not be captured there.

2.3 Documents Involved in Grading

Looking at this paragraph overall, there is a more subtle set of relationships not captured in our class descriptions.

Students take assessments that are administered by instructors. The students’ responses to each question are collected by the instructor, who grades them by comparison to a rubric for each question. The instructor may also elect to provide feedback (written comments), particularly about incorrect responses.

 

Here you can see an attempt to capture those ideas using associations with the appropriate multiplicity.


Documents Involved in Grading (2)

Or, we could even say a little more explicitly how student responses are related to assessments.

 

Here we are indicating that is we know which student we are discussing, we can identify which of the many responses to that assessment was written by that student.

One thing not well captured in our CRC cards is the relation among the documents and the items that make up each document.


Documents Involved in Grading (3)

 

We’ve already documented the aggregation relationship between assessments and questions. We can further take note of the stated relationship of a “rubric for each question”.

 

However, we discovered in our discussion of grading that the response documents and the graded response documents also had a question-by-question organization.


Documents Involved in Grading (4)

What we could not easily show in those unrelated class descriptions, however what that each question is a graded response corresponds to a matching question in a response, which in turn corresponds to a matching question in the original assessment.

 

This diagram, on the other hand, captures the essential parallelism in the document structures.

3 The Documentation Narrative

With these diagrams in hand, we can look back at our original problem statement, our discovered classes, and our newly discovered relationships, and write a narrative for our domain model along the lines of this.