sources of data

10
1.2 SOURCES OF DATA H’MM

Upload: haameem-mohiyuddin

Post on 13-Feb-2017

33 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Sources of data

1.2 SOURCES OF DATAH’MM

Page 2: Sources of data

OBJECTIVES

The learners will be able to: Define Static Data and give examples Define Dynamic Data and give examples Compare the use of static information sources with dynamic information sources Define direct and indirect data source Understand the advantages and disadvantages of gathering data from direct and

indirect data sources

Page 3: Sources of data

DATA STRUCTURE

What is a data structure?“A data structure is a collection of data items that is

implemented by various development tools.”

Page 4: Sources of data

STATIC DATA STRUCTURE“MR. DEPENDABLE”

Page 5: Sources of data

STATIC DATA STRUCTURE

The size of the data structure is fixedStatic data structures are very good for storing a well-defined number of

data items.For example, if we want to design an ID field for employees of an

organization. We can suggest it to be a fixed format e.g. “HIS000”; where the 1st 3 characters are the initials of the organization and the other three the employee number e.g. HIS225.

Page 6: Sources of data

ADVANTAGES OF STATIC DATA STRUCTURES

The development tool can allocate space during compilationEasy to programEasy to check for overflowAllows random access

Page 7: Sources of data

DISADVANTAGES OF STATIC DATA STRUCTURES

The developer has to estimate the maximum amount of space that is going to be needed.

A lot of space maybe wasted.

Page 8: Sources of data

DYNAMIC DATA STRUCTURE“MR. ADAPTABLE”

Page 9: Sources of data

DYNAMIC DATA STRUCTURE

There are many situations where the number of items to be stored in NOT known in advance e.g. the length of someone’s name may NOT be the same as any other’s name.

In this case, the developer would be using a dynamic data structure. This means that the data structure is allowed to grow and shrink as the demand for storage arises.

The developer should also set a maximum size to help avoid memory collisions.

Page 10: Sources of data

DYNAMIC DATA STATIC DATAMemory is allocated to the data structure dynamically.

Memory is allocated at compile time. Fixed size.

Limitation: As the memory allocation is dynamic, it is possible to ‘overflow’ should it exceed it’s allowed limit. It can also ‘underflow’ if it becomes empty.

Benefit: The memory allocation is fixed and so there will be no problem with adding an removing data items.

Benefit: Makes the most efficient use of memory as the data structure – only uses as much memory it needs.

Limitation: Can be very inefficient as the memory for the data structure has been set aside regardless we use it or not.

Limitation: Harder to program as the software needs to keep track of its size and data item locations at all times.

Benefit: Easier to program as there is no need to check on data structure size at any point.