Community resourceWorksheet
OCR H446 2.2.1 Object-oriented scenario solution
Part 12 of 14 · H446 2.2.1 · Programming techniques
By this point in H446 2.2.1 the object model has to come from prose rather than from a supplied diagram. An esports league scenario carries enough facts to derive Team and Match, so students justify what each class owns, implement result state that stays inside each object, then coordinate two collaborating objects.
Students will:
- derive classes, attributes and methods from a written scenario
- state the relationship between two collaborating classes and defend it
- implement a class whose result state is independent of other instances
- write a class that stores and coordinates two objects of another class
- explain why containment suits this design better than inheritance
Inside: 8 explanation cells, 1 fill-in-the-blanks cell, 2 written answers and 2 Python tasks. 25 marks, about 45 to 60 minutes.
Series: H446 2.2.1 · Programming techniques, part 12 of 14.
Shared by Coding PathwayVerified teacher
- 13 cells
- About 45 minutes
- CC BY-SA 4.0
- Shared 31 Aug 2026
- Updated 1 Oct 2026
Preview
The whole resource, exactly as a class sees it. Answers and marking are held back.
Object-oriented scenario solution
Object-oriented techniques are useful when a problem contains entities that have their own state, behaviour and relationships. A local esports league provides enough facts to model Team and Match objects. Begin by retrieving the class, object and constructor rules you need. Then build only the classes required by the scenario and test how the objects interact.
By the end, you will be able to
- extract state and behaviour from scenario nouns and verbs
- choose inheritance or containment from relationships
- implement and test multiple independent objects
- justify a design using scenario evidence
Scenario facts
A Team has a name, wins and losses. It begins with zero wins and losses. record_result(won) adds one win when won is True, otherwise one loss. points() returns wins × 3. summary() returns the name, wins and losses.
A Match stores home and away Team objects. play(home_won) records one result on each team.
Model the scenario before coding
Underline nouns that need persistent state: Team, name, wins, losses, Match, home, away. Circle verbs that become behaviour: record result, calculate points, play.
Then build a responsibility table:
| Class | Owns | Does not own |
|---|---|---|
| Team | its name and result totals | the opposing team |
| Match | references to home and away teams | duplicate copies of team totals |
Test Team first with two objects. Only after independent state is proven should Match coordinate them.
Map the scenario to classes. State two attributes and two methods of Team, then explain the relationship between Match and Team.
Use names from the supplied facts.
Students type their answer here.
Minimum viable model
Implement Team exactly enough to satisfy the supplied behaviour. Keep result state inside each object.
class Team:
passContinue: coordinate two objects
Implement Match. Its constructor stores home and away Team objects. play(home_won) must record opposite results for the two teams.
class Match:
passExplain why Match should contain Team objects rather than inherit from Team.
Use is-a and has-a relationships.
Students type their answer here.
Apply the model further
After the required Team and Match classes pass their checks, plan how a draw could be represented without breaking the existing responsibilities. State which method and data would change before writing any code. This is an enrichment task: it develops design reasoning but introduces no additional OCR terminology.
Checkpoint
Complete the scenario-to-objects summary from memory. There is no answer bank, and correctness is withheld until teacher review.
Review your understanding
Before submitting, check that you can explain the main distinction in your own words, apply it in an unfamiliar context and justify the resulting behaviour or consequence.