In this lesson we will learn about how to use Abstraction including:
Once we know what the problem is, we can then start to take steps to identify:
For example, looking at the Student Information Management System from the previous lesson, we know that the program will need to:
From this, we can identify the information required will include:
At this stage, we can also start to filter out any data or information that is not necessary. If we do not, then there is a real risk that any programmer will attempt to include this information in the programmed solution. This will waste time and money.
One requirement of the SIMS system is that a teacher can look up attendance details about a specific student. To do this, they type the student’s surname, click ‘enter’ and information is displayed.
The information needed will be surname only.
This will give us a list of students with the specified surname, but the information brought back may include their first, middle and last name(s), subject, attendance data and the lesson date and time.
Information not needed is gender, age and date of birth as this is not relevant to the search request.
You are designing a system to allow students to track when homework has been set and when it is due. What data or information is required and what is not necessary?
Abstraction means hiding the complexity of something away from the thing that is going to be using it.
For example, when you press the power button on your computer, do you know what is going on?
Of course not – your computer just turns itself on. That’s all you need to know.
The process of powering up your computer and starting the load process of the Operating System into RAM memory from the boot sector has been hidden from you.
Abstraction in computational thinking is a technique where we split individual parts of the program down into imaginary ‘black boxes’ that carry out operations.
We don’t care HOW the operations are carried out, only that they work consistently and accurately.
For example, in our SIMS system, there will be a ‘search for a student’ process that will make use of the Search Abstraction Layer.
The Search Abstraction Layer contains all the functionality to:
The ‘Search for a Student’ process does not know that the Search Abstraction Layer opens a connection to a database and gets a list of search results; all it knows is that it gives the black box a surname and gets back some results.
This is Abstraction: the student search functionality is hidden away from the rest of the system.
Think of your two favourite games. Can you think of any abstraction in each one?
Once an abstraction layer has been identified, the layer can be described fully by its inputs, outputs, processes, variables and constants. This is called defining the Abstraction Layer.
Consider the student search system, it can be represented using the following terms:
Think back to the Homework Planner program, can you define any Abstraction Layers?
So, to summarise what we have learned in this lesson: