Physical Java — 6. Inheritance

Physical Java is a sequence consisting of the following 6 notional machines:
1. Arrays & Refs
2. Physical Objects
3. Written Objects
4. Refs as Arrows
5. Paper List/ListNode
6. Inheritance

Programming Language

imperative / Java

Form

Representation

Attribution — Origin / Source

Collected by Colleen Lewis — Own practice

Conceptual Advantage

Distinguish between the type of the reference and the type of the object.

Mapping

PLNM
... (all aspects of Physical Java 2)
variable type sticky note with the name of the type next to the pocket that holds the reference
parent reference a remote control that only has buttons corresponding to the things that the parent object knows how to do.
child object a stuffed animal that - as a child - 'does what it wants' and not necessarily what the parent would do.

Draws Attention To

Reference type constrains what methods can be called and object type determines what method is called.

Use When

Introducing inheritance.

Cost

Creating the physical model is a lot of work.

Comments or Feedback?

Do you have feedback on this notional machine? Did you find a mistake, or do you have a request for improvement? You can create an Issue on GitHub, where the description is hosted. This way we can see your feedback and address it.

For this, you need a GitHub account. Then follow this link to see the source file of this page. In there, click the ... left of the highlighted line, then pick "Reference in a new issue".

Create an Issue on GitHub