Example: Domain Model Using CRC Cards Steven Zeil February 13, - - PowerPoint PPT Presentation

example domain model using crc cards
SMART_READER_LITE
LIVE PREVIEW

Example: Domain Model Using CRC Cards Steven Zeil February 13, - - PowerPoint PPT Presentation

Example: Domain Model Using CRC Cards Example: Domain Model Using CRC Cards Steven Zeil February 13, 2013 Example: Domain Model Using CRC Cards Outline Problem Statement 1 Identifying Candidate Classes and Responsibilities 2


slide-1
SLIDE 1

  • Example: Domain Model Using CRC Cards

Example: Domain Model Using CRC Cards

Steven Zeil February 13, 2013

slide-2
SLIDE 2

  • Example: Domain Model Using CRC Cards

Outline

1

Problem Statement

2

Identifying Candidate Classes and Responsibilities

3

Assign Responsibilities to Classes

4

Probable Inheritance Hierarchies

5

Fill in the Candidate Responsibilities

6

The Story So Far That’s Far Enough for Now

slide-3
SLIDE 3

  • Example: Domain Model Using CRC Cards

Example of Early Analysis

This lesson works through an example of the early stages of analysis. Available documentation is natural language, fairly general in nature

Natural language is always tricky to work with. Ambiguities and contradictions are common. You must read carefully and critically.

slide-4
SLIDE 4

  • Example: Domain Model Using CRC Cards

Example of Early Analysis

This lesson works through an example of the early stages of analysis. Available documentation is natural language, fairly general in nature

Natural language is always tricky to work with. Ambiguities and contradictions are common. You must read carefully and critically.

We’re working on a domain model

But we don’t yet have enough info for a complete model

slide-5
SLIDE 5

  • Example: Domain Model Using CRC Cards

Example of Early Analysis

This lesson works through an example of the early stages of analysis. Available documentation is natural language, fairly general in nature

Natural language is always tricky to work with. Ambiguities and contradictions are common. You must read carefully and critically.

We’re working on a domain model

But we don’t yet have enough info for a complete model

What do we hope to accomplish?

Learn as much as possible from the info provided material Reveal questions for later, more detailed follow-up

slide-6
SLIDE 6

  • Example: Domain Model Using CRC Cards

Example of Early Analysis

This lesson works through an example of the early stages of analysis. Available documentation is natural language, fairly general in nature

Natural language is always tricky to work with. Ambiguities and contradictions are common. You must read carefully and critically.

We’re working on a domain model

But we don’t yet have enough info for a complete model

What do we hope to accomplish?

Learn as much as possible from the info provided material Reveal questions for later, more detailed follow-up

Mistakes will be made!

slide-7
SLIDE 7

  • Example: Domain Model Using CRC Cards

Problem Statement

Outline I

1

Problem Statement

2

Identifying Candidate Classes and Responsibilities

3

Assign Responsibilities to Classes

4

Probable Inheritance Hierarchies

5

Fill in the Candidate Responsibilities

6

The Story So Far That’s Far Enough for Now

slide-8
SLIDE 8

  • Example: Domain Model Using CRC Cards

Problem Statement

Problem Statement I

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

slide-9
SLIDE 9

  • Example: Domain Model Using CRC Cards

Problem Statement

Problem Statement II

  • 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

  • nly. 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.

slide-10
SLIDE 10

  • Example: Domain Model Using CRC Cards

Identifying Candidate Classes and Responsibilities

Outline I

1

Problem Statement

2

Identifying Candidate Classes and Responsibilities

3

Assign Responsibilities to Classes

4

Probable Inheritance Hierarchies

5

Fill in the Candidate Responsibilities

6

The Story So Far That’s Far Enough for Now

slide-11
SLIDE 11

  • Example: Domain Model Using CRC Cards

Identifying Candidate Classes and Responsibilities

Identifying Candidate Classes and Responsibilities I

For the initial list, mark up the description, looking for noun phrases and verb phrases . ODU offers a number of courses via the Internet. A common requirement among these courses is for a system of on-line

  • 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

slide-12
SLIDE 12

  • Example: Domain Model Using CRC Cards

Identifying Candidate Classes and Responsibilities

Identifying Candidate Classes and Responsibilities II

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

  • nly. 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

slide-13
SLIDE 13

  • Example: Domain Model Using CRC Cards

Identifying Candidate Classes and Responsibilities

Identifying Candidate Classes and Responsibilities III

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 .

slide-14
SLIDE 14

  • Example: Domain Model Using CRC Cards

Identifying Candidate Classes and Responsibilities

Candidate Classes

assessment, exams, quizzes, exercises, self-assessments, questions, true/false question, single-choice question, multiple choices question, fill-in-the-blank question, essay question, students, instructors, responses, rubric, feedback, score, grade book, information, performance, instructor’s answer

slide-15
SLIDE 15

  • Example: Domain Model Using CRC Cards

Identifying Candidate Classes and Responsibilities

Candidate Responsibilities

contain (questions), take (assessment), administer, collect (responses), grade, provide (feedback), compute (score), record (score), return (information)

slide-16
SLIDE 16

  • Example: Domain Model Using CRC Cards

Assign Responsibilities to Classes

Outline I

1

Problem Statement

2

Identifying Candidate Classes and Responsibilities

3

Assign Responsibilities to Classes

4

Probable Inheritance Hierarchies

5

Fill in the Candidate Responsibilities

6

The Story So Far That’s Far Enough for Now

slide-17
SLIDE 17

  • Example: Domain Model Using CRC Cards

Assign Responsibilities to Classes

Assign Responsibilities to Classes I

Start by drawing up CRC cards.

Assessment Exam Quiz Exercise Self-Assessment Question True/False Question Single-Choice Question Multiple Choices Question Fill-In-The-Blank Question Essay Question Student Instructor Response

slide-18
SLIDE 18

  • Example: Domain Model Using CRC Cards

Assign Responsibilities to Classes

Assign Responsibilities to Classes II

Rubric Feedback Score Grade Book Information Performance Correct Answer

slide-19
SLIDE 19

  • Example: Domain Model Using CRC Cards

Probable Inheritance Hierarchies

Outline I

1

Problem Statement

2

Identifying Candidate Classes and Responsibilities

3

Assign Responsibilities to Classes

4

Probable Inheritance Hierarchies

5

Fill in the Candidate Responsibilities

6

The Story So Far That’s Far Enough for Now

slide-20
SLIDE 20

  • Example: Domain Model Using CRC Cards

Probable Inheritance Hierarchies

Probable Inheritance Hierarchies I

Since all of the various kinds of assessments are likely to have similar responsibilities and collaborators, let’s stack their cards for now and treat them as a unit. We’ll do the same with the various kinds of questions.

Assessment Question Student Instructor Response Rubric Feedback Score

slide-21
SLIDE 21

  • Example: Domain Model Using CRC Cards

Probable Inheritance Hierarchies

Probable Inheritance Hierarchies II

Grade Book Information Performance Correct Answer

slide-22
SLIDE 22

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

Outline I

1

Problem Statement

2

Identifying Candidate Classes and Responsibilities

3

Assign Responsibilities to Classes

4

Probable Inheritance Hierarchies

5

Fill in the Candidate Responsibilities

6

The Story So Far That’s Far Enough for Now

slide-23
SLIDE 23

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

Fill in the Candidate Responsibilities

Now fill in the operations known so far: contain (questions) take (assessment), administer, collect (responses), grade, provide (feedback), compute (score), record (score), return (information),

slide-24
SLIDE 24

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

contain questions

An assessment can contain a number of questions . This is really a statement about attributes of an assessment

Assessment Has questions

slide-25
SLIDE 25

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

taking and administering assessments

Students take assessments that are administered by instructors . Is this really two separate operations? The language (plurals) is a bit tricky.

Instructors administer an assessment to an entire class. Each student individually takes the assessment. Instructor administer assessment to group of Students

slide-26
SLIDE 26

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

Taking or Administering?

Surprised that I put that in Instructor?

slide-27
SLIDE 27

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

Taking or Administering?

Surprised that I put that in Instructor? Remember the basic rule: if A does B to C, then "do B" is usually a responsibility of C

slide-28
SLIDE 28

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

Taking or Administering?

Surprised that I put that in Instructor? Remember the basic rule: if A does B to C, then "do B" is usually a responsibility of C It would not be a responsibility of the assessment

Tests don’t administer themselves ITRW

slide-29
SLIDE 29

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

Taking or Administering?

Surprised that I put that in Instructor? Remember the basic rule: if A does B to C, then "do B" is usually a responsibility of C It would not be a responsibility of the assessment

Tests don’t administer themselves ITRW

Could it be a responsibility of the Student?

No, the statement says that students “take”assessments, But is “take assessment” simply a synonym for “accept administration of an assessment”?

slide-30
SLIDE 30

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

What’s involved in administering an assessment?

The problem statement tells us: Students take assessments that are administered by instructors. The students’ responses to each question are collected by the instructor, who grades them . . . 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.. . . Information is returned to the student about their performance. We’re looking at the instructor’s method for administering an assessment. a strong suggestion that administration of an assessment is far more involved than simply having a student “take” it.

and that they are, therefore, separate responsibilities.

slide-31
SLIDE 31

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

taking an assessment

So we add the student’s role into our model:

Student take an Assessment Assessment Instructor administer assessment to group of Students Student

slide-32
SLIDE 32

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

collecting responses

The students’ responses to each question are collected by the instructor This is really just describing the output from the request sent to students asking them to take the assessment.

Student take an Assessment: Response Assessment

slide-33
SLIDE 33

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

grading responses

the instructor , who grades them by comparison to a rubric for each question.

Response grade Instructor administer assessment to group of Students Student Response

not a responsibility of the instructor, because we are still tracing out the steps that constitute the instructor’s method for administering an assignment

slide-34
SLIDE 34

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

Working with Rubrics

We are told there is a separate rubric for each question. So the “comparison” is between a response to a single question and a rubric. This highlights the distinction between the response to an assessment and the responses to individual questions.

We don’t know what the proper terminology here would be, so we use a placeholder and make a note to consult the domain experts. Response has QuestionResponses? Rubric grade all question responses via a seq of Rubrics QuestionResponse? grade(Rubric): score

slide-35
SLIDE 35

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

Wait a minute...

Response has QuestionResponses? Rubric grade all question responses via a seq of Rubrics QuestionResponse? grade(Rubric): score

At this point, sanity reasserts itself ITRW, when a student returns an exam sheet or a bluebook (the Response), those things don’t grade themselves.

slide-36
SLIDE 36

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

Wait a minute...

Response has QuestionResponses? Rubric grade all question responses via a seq of Rubrics QuestionResponse? grade(Rubric): score

At this point, sanity reasserts itself ITRW, when a student returns an exam sheet or a bluebook (the Response), those things don’t grade themselves.

They’re just paper

slide-37
SLIDE 37

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

Wait a minute...

Response has QuestionResponses? Rubric grade all question responses via a seq of Rubrics QuestionResponse? grade(Rubric): score

At this point, sanity reasserts itself ITRW, when a student returns an exam sheet or a bluebook (the Response), those things don’t grade themselves.

They’re just paper And while anthropomorphism is common in OO modeling, that may be going a little too far.

slide-38
SLIDE 38

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

What are our options?

Response has QuestionResponses? Rubric grade a seq of Questions via a seq of Rubrics QuestionResponse? grade(Rubric): score

First thought: the instructor does the grading

but it’s not really a responsibility of the instructor because no

  • ne in this model tells the instructor to take this step

it’s part of the Instructor’s “administer an assessment” method

But not mentioning it all in the model seems wrong

So let’s think about what we want to eventually capture

slide-39
SLIDE 39

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

Looking for Variant Behavior

One reason that we really want to model the grading process is that we know that we have many different kinds of questions:

Question True/False Question Single-Choice Question Multiple Choices Question Fill-In-The-Blank Question Essay Question

and we suspect that the grading method varies from one type of question to another. So perhaps we should say

Question grade(Rubric) Rubric

slide-40
SLIDE 40

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

But I Don’t Like That Either

. . . and here’s why: Essay questions can cover all kinds of things.

slide-41
SLIDE 41

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

But I Don’t Like That Either

. . . and here’s why: Essay questions can cover all kinds of things.

“English” essays where grammar and sentence construction are graded

slide-42
SLIDE 42

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

But I Don’t Like That Either

. . . and here’s why: Essay questions can cover all kinds of things.

“English” essays where grammar and sentence construction are graded General essays where content is more important than form

slide-43
SLIDE 43

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

But I Don’t Like That Either

. . . and here’s why: Essay questions can cover all kinds of things.

“English” essays where grammar and sentence construction are graded General essays where content is more important than form Mathematical proofs

slide-44
SLIDE 44

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

But I Don’t Like That Either

. . . and here’s why: Essay questions can cover all kinds of things.

“English” essays where grammar and sentence construction are graded General essays where content is more important than form Mathematical proofs Code an algorithm, and so on

slide-45
SLIDE 45

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

But I Don’t Like That Either

. . . and here’s why: Essay questions can cover all kinds of things.

“English” essays where grammar and sentence construction are graded General essays where content is more important than form Mathematical proofs Code an algorithm, and so on

Are these really the same kind of question?

slide-46
SLIDE 46

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

But I Don’t Like That Either

. . . and here’s why: Essay questions can cover all kinds of things.

“English” essays where grammar and sentence construction are graded General essays where content is more important than form Mathematical proofs Code an algorithm, and so on

Are these really the same kind of question?

They share lots of behaviors (e.g., they are represented the same way on the printed page, students use the same mechanism for answering them)

slide-47
SLIDE 47

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

But I Don’t Like That Either

. . . and here’s why: Essay questions can cover all kinds of things.

“English” essays where grammar and sentence construction are graded General essays where content is more important than form Mathematical proofs Code an algorithm, and so on

Are these really the same kind of question?

They share lots of behaviors (e.g., they are represented the same way on the printed page, students use the same mechanism for answering them) But the rubrics for grading them are very different

slide-48
SLIDE 48

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

But I Don’t Like That Either

. . . and here’s why: Essay questions can cover all kinds of things.

“English” essays where grammar and sentence construction are graded General essays where content is more important than form Mathematical proofs Code an algorithm, and so on

Are these really the same kind of question?

They share lots of behaviors (e.g., they are represented the same way on the printed page, students use the same mechanism for answering them) But the rubrics for grading them are very different

So maybe it’s the rubrics that capture this behavior

slide-49
SLIDE 49

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

Grading - revised

Response has QuestionResponses? Rubric grade a seq of Questions via a seq of Rubrics QuestionResponse? grade(Rubric): score Question grade(Rubric) Rubric Rubric grade(QuestionResponse?): score

I’m much happier with that Can rubrics be “intelligent” or is this unacceptable anthropomorphism again?

ITRW, rubrics for essay question, in particular, are often expressed in ways that assume a human intelligence

We’re probably going to wind up with a small deck of Rubric cards for different variants.

slide-50
SLIDE 50

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

provide feedback

The instructor may also elect to provide feedback (written comments), particularly about incorrect responses.

GradedQuestionResponse? Has score, feedback

Another case of needing to consult the domain experts to find the proper name for a graded question response.

slide-51
SLIDE 51

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

computing scores

A total score for the assessment is computed by the instructor.

GradedResponse? has GradedQuestionResponses compute total score

slide-52
SLIDE 52

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

recording grades

the instructor records the score in his/her grade book .

GradeBook record a score for a Student on an Assessment Instructor administer assessment to group of Students Student Response Grade Book

slide-53
SLIDE 53

  • Example: Domain Model Using CRC Cards

Fill in the Candidate Responsibilities

returning information

Information is returned to the student about their performance . It’s a pretty good bet that we don’t want a class with as vague a name as "Information". But we’ve already encountered the concept under a better name The clue is the description: “At a minimum, the student would learn of their score and any instructor-provided feedback.”

Student take an Assessment: Response Assessment receive a GradedResponse

slide-54
SLIDE 54

  • Example: Domain Model Using CRC Cards

The Story So Far

Outline I

1

Problem Statement

2

Identifying Candidate Classes and Responsibilities

3

Assign Responsibilities to Classes

4

Probable Inheritance Hierarchies

5

Fill in the Candidate Responsibilities

6

The Story So Far That’s Far Enough for Now

slide-55
SLIDE 55

  • Example: Domain Model Using CRC Cards

The Story So Far

The Story So Far I

Assessment Has questions GradeBook record a score for a Student on an Assessment GradedQuestionResponse? Has score, feedback GradedResponse? has GradedQuestionResponses? compute total score Instructor administer assessment to group of Students Student Response Grade Book Question grade(Rubric) Rubric QuestionResponse? grade(Rubric): score

slide-56
SLIDE 56

  • Example: Domain Model Using CRC Cards

The Story So Far

The Story So Far II

Response has QuestionResponses? Rubric grade a seq of Questions via a seq of Rubrics Rubric grade(QuestionResponse): score Student take an Assessment: Response Assessment receive a GradedResponse

We might (cautiously) question whether some of the empty cards represent classes that we need to retain in the model. But we’re still very early in the discovery process

slide-57
SLIDE 57

  • Example: Domain Model Using CRC Cards

The Story So Far That’s Far Enough for Now

That’s Far Enough for Now

Right now, we have as many questions as answers. but finding useful questions is part of the process We can’t go much further without more info

. . . and it’s very dangerous to start making stuff up based on intuition about how we think the program could work.