Skip to main content

About this free course

Download this course

Share this free course

Introduction to computational thinking
Introduction to computational thinking

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

2.2 Encapsulation

The model of the solar system in Figure 10 also illustrates the second type of abstraction: abstraction as encapsulation. The brass cylinder in the middle of the device encloses a clockwork of cogwheels similar to the one in Figure 10.

Described image
Figure 10 The inside of an orrery

This mechanism causes the small spheres representing the planets to rotate around the centre at a velocity that is proportional to the speed of the actual planets. The mechanism is hidden from view for the casual user, who is only interested in the movement of the planets. Figure 11 illustrates this other view of the orrery in terms of two layers.

Described image
Figure 11 The orrery as two layers

Generally, abstraction as encapsulation involves the two layers shown in Figure 12.

Described image
Figure 12 The two layers involved in abstraction as encapsulation

The layer through which the user interacts with the model is called the interface. It hides the detailed workings of the model from the user. The interface sits between the user and the layer at which the model is implemented. The latter is responsible for making the model do what it is supposed to do. This is where the automation of the model takes place.