2.1/2.2 Flashcards
(13 cards)
need for abstraction
hiding unnecessary detail and only showing detail that is relevant to the problem.
saves time, money, resources
procedural abstraction
when you write code sections that are generalised with variable parameters
say what you want the code to do and be explicit to do just that
functional abstraction
provides methods to do work while hiding details of how it’s done
inputs
include any data that is required to solve a problem
entered into the system by the user
outputs
results passed back once the inputs have been processed and the problem has been solved
data types
string
integer
floating point
boolean
data abstraction
providing any essential info to the outside world while hiding background details
emphasises clear separation between external interface of objects and internal data handling and manipulation
problem abstraction
ignoring characteristics of problems that are not needed in order to concentrate on those that are
instructs that we remove all specific data and patterns that will not help us solve the problem
reusable programming
makes it quicker
saves time and costs
can be reused for other programs
allows other programmer to use others expertise
may require fewer developers working on a project
determining preconditions
requirements which must be met before a program can be executed
if preconditions are not met the program will fail to execute or return an invalid answer
subroutines become more reusable
caching
data retrieved from secondary storage and placed into main memory often remain there until the program using them ends
faster retrieval times
improves speed and efficiency
decreases no of requests on web pages
prefetching
data being requested from main memory by the processor before it’s actually required
drawbacks
nature of predictive logic means caching algorithms are complicated to implement
wrong data is often fetched and cached
this must be removed or flushed