1/19
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is abstraction?
It is the process of removing excessive details to arrive at a representation of a problem that consists of only the key features.
What is Representational abstraction?
Abstraction that is relevant to a given scenario and simplifying a problem based on that.
What is abstraction by generalisation
form of abstraction involves grouping together similarities within a problem to identify what kind of problem. This allows problems to be categorised and a common solution to be found.
What is Data abstraction?
a subcategory of abstraction in which details about how data is being stored are hidden.
What is procedural abstraction?
Programmers can also perform functions such as pushing and popping items to and from a stack without having any knowledge about the code used to implement this functionality.
High level vs Low level abstraction
High level-closest to the user and are usually responsible for providing an interface for the user to interact with hardware.
Low level-responsible for actually performing these tasks through the execution of machine code.
What to consider when devising an abstract model
āWhat is the problem that needs to be solved by the model and what are its key features?
āHow will the model be used (Consider factors such as Convenience, accessibility and affordability)?
āWho will the model be used by? (Audience)
āWhich parts of the problem are relevant based on the target audience and the purpose of the model?
Inputs and Outputs when thinking Ahead
āGoal/Outcome-Begin by thinking what is the goal of your computer system-What is it's purpose? What are it's outputs?
āOutputs-How is the output going to be displayed/ processed? : Visual, Audio, Haptic feedback, As input data into another system/program.
āInputs-Then think how can we gain inputs to make this possible-Ask the user for various data.
āProcess-Think about process required to produce desired outcome from the system using the inputs.
āPreconditions- Considering conditions that may affect how you design a program/algorithm to meet your goal.
Importance of reusability
Commonly used functions are often packaged into libraries for reuse. This allows for: Shortened development time, Lower development costs and reduce redundancy in coding.
Also, reused code is usually ore reliable as it has already been tested and any bugs have been dealt with.
External reuse of code
Selling components to third parties. This can allow for developers to reap the benefits of accounts being linked to different apps and websites, thus allowing for certain procedures and functions to be made available to other developers via an Application Programming Interface(API).
What is Caching?
Caching is the process of storing instructions or values in cache memory after they have been used, as they may be used again. This saves time which would have been needed to store and retrieve the instructions from secondary storage again.
What is precaching/prefetching?
when algorithms predict which instructions are likely to soon be fetched. The instructions and data which are likely to be used are then loaded and stored in cache before they are fetched. Can lead to significant improvement in performance if implemented effectively.
Limits of Precaching/Prefetching?
Due to the nature of predictive logic, sometimes the wrong data is cached and subsequently, it has to be removed or flushed. Maintaining correct sequence of data items in these cases can be problematic.
How to think procedurally
āIdentify components of a problem- It is important to analyse a problem and decompose it into smaller more manageable chunks as well as determine the modules you need to write for each problem.
āStepwise refinement using a top-down modular design- Program is split into smaller sub-tasks with the aim of developing a diagram where each sub task can be tackled as a small independent modules.
āEach subtask can then be appropriately distributed to programmers or teams of programmers which can develop and test a program before integrating it into the overall solution.
It is possible that once distributed that the subtasks can be decomposed further.
How to think logically
āLimit the possible solutions we can pick from. (Come to a conclusion on the most efficient way of solving a program taking into account the preconditions)
Identify where decisions will need to be made (By you/your team, the program and by the user)
āConsider key factors in the outcome of a decision (Most effective, Convenient and reasonable method)
āEvaluate these conditions and order them from most important to least important. (Prioritise based on effectiveness, Convenience and feasibility).
What is concurrent processing?
the process of completing āmore than one taskā at a given time; different tasks are given slices of processor time, to give the illusion that tasks are being performed simultaneously. (different to Parallel processing).
What is concurrent thinking?
the mindset that allows you to spot patterns and parts of problems where concurrency can be applied.
How to think Concurrently
Assessing which parts of the problem are related.
Advantages of concurrent processing
ā The number of tasks completed in a given time is increased.
ā Less time is wasted waiting for an input or user interaction, as 8other tasks can be completed.
Disadvantages of concurrent processing
ā Concurrent processing can take longer to complete when large numbers of users or tasks are involved as processes cannot be completed at once.
ā There is an overhead in coordinating and switching between processes, which reduces program throughput.
ā Just as with parallel processing, not all tasks are suited to being broken up and performed concurrently.