Extra general Flashcards
(86 cards)
When should you use local variables and when should you use global variables
If you feel that a certain variable will take multiple values by passing through various functions then use local variables and pass them in function calls. If you feel that a certain variable you need to use will have constant value, then declare it as a global variable
What is top down design
breaking a problem down
Advantages of top down design
the problem is easier to understand, program, test and maintain.
Shows clearly how different parts of the problem relate to each other
Division of labour - different teams working on different parts of the problem independently
May make code more modular as it broken into smaller subroutines
Disadvantages of top down design
It assumes that the whole solution to the problem is knowable in advance.
Poorly understood programs are hard to decompose.
Not every problem can be broken down in this way, for example event driven programs like GUIs
What are the 4 values of the agile methods
1.Individuals over processes
2.Working software over documents
3.Customer collab
change
Pros of flat file databases
Easy to set up - no knowledge required
Easy to use in code - e.g. CSV files are easy to process
Easy to share, e.g. email attachments
Cons of flat file databases
Duplication of data (data redundancy) which take more time to update eg if Miss Read moves house you have to update her address in multiple rows, can lead to inconsistency eg you forget to update Miss Read’s details in every place they are stored.
Take up more space so more storage is required.
Everyone can see everything (not good if some data is sensitive)
Inefficient – have to have all fields for every record
Can’t perform complex queries as easily
Pros of relational databases
Reduces duplication of data meaning easier to update, accurate, better consistency, less storage space
Can set different access rights for each user for each table
Can index fields for quicker searching
If implemented with DBMS, it will allow concurrent access to the database allowing multiple users
Complex queries can be carried out
Cons of relational databases
More difficult to correctly set up (normalization is the process of structuring the data in a relational database according to formal rules to avoid problems of data redundancy which leads to inconsistency and inaccuracy (incorrect) and inconsistency (between different fields)
Cons of cache
small size and fixed size
Pros of web browser cache
Faster load time, reduced network traffic ie fewer HTTP requests
Cons of web browser cache (cache in general)
Cached resource may be out of date
What does a cache server (proxy server) do?
Cache server (proxy server) saves previously requested web pages or other content.
Pros of caching a proxy server
Faster load time as HTTP request does not have to go original web server, reduces network traffic
When is DNS cache used?
When a DNS server responds to a DNS request, the operating system may store these results in a local DNS cache
Pros of DNS cache?
reduced network traffic ie fewer DNS requests.
Reduced network traffic as there will be fewer DNS requests to remote DNS servers
Cons of DNS cache?
resources may be out of date, if a web page has changed the location of its server an error may occur
Pros of caching in general
Speeds up retrieval
Cache miss normally would not result in error
Cons of caching
Algorithms for caching can be very complicated. When the cache is full, the algorithm must choose which items to discard to make room for the new ones.
Wrong data may be cached then it has to be removed and the correct data loaded.
Cache does not have the required content (cache miss) so time is wasted checking it.
What is a cache hit
dataA “cache hit” occurs when a file is requested from a cache and the cache is able to fulfill that request
What is a cache miss
an event in which a system or application makes a request to retrieve data from a cache, but that specific data is not currently in cache memory
What does atomic mean
Atomic means each item of data is distinct and you can’t separate the data any more or break it up any smaller without losing meaning.
atomicity
The fully or not at all transaction thing
When would you not have to do anything for second normal form
If you don’t have any composite primary keys