2. 1. 1 Thinking Abstractly Flashcards
1
Q
The nature of abstraction
A
- It is the process of removing excessive details to come to a representation of a problem that consists of only the key features
- Icons is a great example of abstraction, suggest a function or process in a simple and efficient way
2
Q
Representational Abstraction
A
- Analysing what is relevant to a given scenario and simplifying a problem based on this info
3
Q
Abstraction by generalisation
A
- This involves grouping together similarities within a problem to identify the type of problem being dealt with
- Allows categorisation of problem being of a particular type so that a common solution can be used to solve these problems
4
Q
Data and Procedural abstraction
A
- A subcategory of abstraction, details about how data is being stored is hidden
- Programmers can use abstract data structures (stacks, queues) without concerning themselves with how the structures are implemented
- Programmers can also perform functions (pushing, popping etc) in a stack without having knowledge of the code used for this functionality, known as procedural abstraction also used in decomposition
- Models what subroutine does without considering how this is done
- Once procedure coded, can be reused as a black-box
5
Q
Abstraction in large complex problems
A
- Larger more complex problems use multiple levels of abstraction, each level performs different role
- Highest levels of abstraction are closest to user, usually responsible for providing interface for user to interact with hardware
- Lowest levels responsible for performing these tasks through execution of machine code
6
Q
The need for abstraction
A
- Allows non-experts to make use of range of systems or models by hiding info that is too complex or irrelevant to the systems purpose
- For example, a gamer does not need to know how the game has been coded
- Enables more efficient design during software development, programmers can focus on elements that need to be built in software rather than unnecessary details being a concern
- Reduces time needed to on the project, prevents program from getting unnecessarily large by removing wasteful details early
7
Q
Abstraction in programming languages
A
- PL can be separated into spectrum of high-level and low-level languages
- Low-level like assembly code and machine code directly interact with computer systems, more difficult to write
- Requires an understanding off binary codes and memorisation of mnemonics
- High-level provides abstraction for machine code, makes development easier, syntax parallels natural language in high-level, considerably easier to learn compared to low-level
- This makes coding accessible to non-specialists
8
Q
Abstraction in networking
A
- TCP/IP model is an abstraction for how networks function, separated into four layers
- Each layer deals with different part off communication process, separating them makes them simpler to understand
- Does not need to know what is happening on other layers
- Important to ensure compatibility between layers so standards must be agreed on in advance
- The model uses a set of protocols is that each layer can be dealt with individually, details about other layers hidden
- Basically, abstraction gives us a more simplified understanding of how the model works
9
Q
Difference between abstraction and reality
A
- Abstraction is a simplified representation of reality; real-world entities can be represented using computational structures such as tables and databases
- Real-world values often stored as variables; OOP uses objects which is an abstraction for real-world entities
- Basically, abstraction acts as a representation through OOP and some data structures
10
Q
Things to consider when devising an abstract model
A
- What is the problem that needs to be solved?
- What are the key features of the problem?
- Can it be solved computationally?
- How will the model be used?
- What sort of format does the model need to be displayed in?
- Consider factors such as convenience, affordability and ease of access
- Who will the model be used by?
- How many people will be using the model?
- What level of expertise do they have in the subject/ discipline associated with the problem?
- Which parts of the problem are relevant based on the target audience and the purpose of the model?
- Remove sections that are not relevant to the problem that needs solving
- Remove details that will confuse the audience