Objects, state and responsibility: Representations and decisions
≈ 36 minObjects, state and responsibility: Representations and decisions
Object-oriented programming models a domain using classes. A class defines useful state and behaviour; each object has its own state. Encapsulation keeps a class responsible for protecting the rules that make that state valid.
Learning move. In this lesson, choose a diagram, table, trace or model that makes the decision visible.
Worked example. A Book object stores its title and loan state. Two copies of the same novel are two objects because one can be available while the other is borrowed.
Which statement best reflects this lesson's encapsulation?
Write the key term for this lesson: encapsulation.
A school system needs a reliable next step. Which choice is most defensible for this topic?
A learner can repeat a definition from Objects, state and responsibility: Representations and decisions. Which next task gives stronger evidence of mastery?

