Analysing what is relevant to a given scenario and simplifying a problem based on this information
Abstraction enables more efficient design during software development by focusing on essential elements, reducing project time and preventing unnecessary program size
Data abstraction
Hiding details about how data is being stored, allowing the use of abstract data structures without concern for implementation
Multiple levels of abstraction
Used in very large, complex problems where each level performs a different role, with highest levels providing user interface and lowest levels executing machine code
Abstraction by generalisation
Grouping together similarities within a problem to identify what kind of problem it is, allowing categorization and common solutions
Abstraction
Removing excessive details to arrive at a representation of a problem that consists of only the key features
Programming languages can be separated into
High-level languages
Low-level languages
Abstraction allows non-experts to make use of systems or models by hiding complex or irrelevant information
Procedural abstraction
Performing functions like pushing and popping items without knowledge of the code used for implementation, used in decomposition
Low-level languages such as assembly code and machine code directly interact with computer systems but are more difficult to write
Assembly code, although easier to memorize, still requires programmers to know the mnemonics associated with it
Layers of abstraction used in
Networking
Programming languages
Assembly code and machine code
Languages that directly interact with computer systems but are more difficult to write
Attributes in object-oriented programming
Abstraction for the characteristics of an object
Assembly code
Easier to memorise but requires knowledge of mnemonics associated with the instruction set specific to the processor
Devising an abstract model for a variety of situations
Consider the problem to be solved, key features, usage, target audience, and relevance of problem parts
Abstraction
A simplified representation of reality
Coding has become accessible to non-specialists due to the abstraction provided by high-level languages
High-level languages
Provide an abstraction for machine code, making programming easier as syntax parallels natural language and is considerably easier to learn and use compared to low-level languages
Object-oriented programming
Makes use of objects as an abstraction for real-world entities, considering functionality, interface, and properties
Methods in object-oriented programming
Abstraction for the actions a real-world object can perform
Inputs
Data required to solve the problem, entered into the system by the user
Designing a solution
1. Thinking ahead about the different components of a problem and how they will be handled in the best way possible
2. Considering problems or difficulties that may arise when the software is used
3. Designing strategies to make programs easy and intuitive to use
Preconditions are requirements that must be met before a program can be executed
Identifying inputs and outputs for a given scenario
Deciding on suitable data type, structure, and method to present the solution
Preconditions can be tested for within the code or included in the documentation accompanying a subroutine, library, or program
Outputs
Results passed back once the inputs have been processed and the problem solved
Specifying preconditions
Ensuring arguments passed meet certain criteria as defined by the preconditions
All computational problems consist of inputs which are processed to produce an output
Caching frees up bandwidth for other tasks on a network
Caching is the process of storing instructions or values in cache memory after they have been used, as they may be used again
Caching is very common in the storage of web pages
Prefetching loads and stores instructions and data in cache before they are fetched, reducing the time spent waiting for instructions to be loaded into RAM from the hard disk
The effectiveness of caching depends on how well a caching algorithm manages the cache
Including preconditions within the documentation reduces the length and complexity of the program as well as saving time needed to debug and maintain a longer program
Reusable program components are often packaged into libraries for reuse
Reusable components are more reliable than newly-coded components as they have already been tested and any bugs dealt with, saving time, money, and resources
Compatibility issues may arise when integrating existing components developed by third parties with the rest of the software, potentially requiring modifications which can be costly and time-consuming
Web pages that a user frequently accesses are cached to load content without any delay
The purpose of preconditions is to ensure necessary checks are carried out before the execution of a subroutine, making subroutines more reusable