HomeChallengesRepsProblemsLeaderboardTake a challenge

Write the top line first

“As a parent, I want to know when my child first celebrates a birthday at school.” Write the answer as one line that calls methods which do not exist yet, then make them exist.

Intermediate15 min on the clock5 graded checks · 100 pointsDesigning an Object ModelPro
Graded by reading your code against the checklist below.

What you build

  • Write GetFirstCelebrationAt(SchoolSystem school) as one line in the story’s terms
  • Stub any method that does not exist yet with throw new NotImplementedException()
  • Implement the stubs until none remain
  • Trace both children’s first celebrations into Answers.cs

Done means

One line in domain terms, no stubs left, the new helper on Date, and both celebrations traced.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else.

  1. The top method is one line in domain terms+20Tell, don’t ask
  2. No NotImplementedException left+20Tell, don’t ask
  3. Both celebrations traced correctly+30Tell, don’t ask
  4. The new helper lives on Date+15Tell, don’t ask
  5. The child passes itself to the school+15Data that belongs to one object

What it teaches

Data that belongs to one objectbeginner

A static field exists once for everyone, so two callers overwrite each other; an object is a private copy of the data, and its methods reach that copy through the this the compiler passes for you.

The rest of Designing an Object Model