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 30 to 45 minutes.

Series: H446 2.2.1 · Programming techniques, part 12 of 14.

Shared by Coding PathwayVerified teacher

  • 13 cells
  • About 30 minutes
  • CC BY-SA 4.0
  • Shared 31 Aug 2026
  • Updated 3 Sept 2026

Preview

The whole resource, exactly as a class sees it. Answers and marking are held back.

Object-oriented scenario solution

Complete the sections in order, beginning with retrieval or model selection and then applying the ideas in integrated contexts. No new required knowledge is introduced.

A local esports league provides enough facts to derive collaborating Team and Match classes. Build and test the minimum model before extending it.

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

Reactivate: constructors, encapsulation and object interaction.

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:

ClassOwnsDoes not own
Teamits name and result totalsthe opposing team
Matchreferences to home and away teamsduplicate copies of team totals

Test Team first with two objects. Only after independent state is proven should Match coordinate them.

Written answer5 marks

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.

Coding task8 marks
class Team:
    pass

Continue: coordinate two objects

Implement Match. Its constructor stores home and away Team objects. play(home_won) must record opposite results for the two teams.

Coding task5 marks
class Match:
    pass
Written answer3 marks

Explain why Match should contain Team objects rather than inherit from Team.

Use is-a and has-a relationships.

Students type their answer here.

Optional extension

Add a draw result and a league table only after the required model works. This extension is not needed for the stated OCR evidence.

Checkpoint

Complete the scenario-to-objects summary from memory. There is no answer bank, and correctness is withheld until teacher review.

Fill in the blanks4 marks
A Match checkpoint gap 1 two Team objects, so this is a checkpoint gap 2 relationship rather than inheritance. Each Team constructor creates checkpoint gap 3 state. A method should change only the object whose state is its checkpoint gap 4.

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.