Designing data dictionaries
Any solution will use appropriate data storeA data store is a location for keeping and managing collections of data including databases and simpler types such as files and emails, data typeThe format in which a variable or constant holds data, such as âintegerâ or âstringâ. and provide accurate data validationChecking input data is sensible and in the right format.. This can be achieved by outlining all data stores in a data dictionary.
For our example, a simple data dictionary would contain:
Name | Data type | Validation | Example data | Notes |
validateName | Function | N/A | N/A | Function to capture, validate and return name |
name | String | <= & not Null | 'John' | Name variable to be used in NAME function |
valid | Boolean | N/A | TRUE, FALSE | A flag variable to start and stop validation loop |
a | Integer | >0 AND <=10 | 1 | variable to store random number |
b | Integer | >0 AND <=10 | 1 | variable to store random number |
Data | Array | Array structure to hold the name and score | ["John",8] | Array will hold data to be written to the text file |
Name | validateName |
---|---|
Data type | Function |
Validation | N/A |
Example data | N/A |
Notes | Function to capture, validate and return name |
Name | name |
---|---|
Data type | String |
Validation | <= & not Null |
Example data | 'John' |
Notes | Name variable to be used in NAME function |
Name | valid |
---|---|
Data type | Boolean |
Validation | N/A |
Example data | TRUE, FALSE |
Notes | A flag variable to start and stop validation loop |
Name | a |
---|---|
Data type | Integer |
Validation | >0 AND <=10 |
Example data | 1 |
Notes | variable to store random number |
Name | b |
---|---|
Data type | Integer |
Validation | >0 AND <=10 |
Example data | 1 |
Notes | variable to store random number |
Name | Data |
---|---|
Data type | Array |
Validation | Array structure to hold the name and score |
Example data | ["John",8] |
Notes | Array will hold data to be written to the text file |
Include all variables (including counterA special variable that is used to count the number of times a loop is called. Also known as a control variable. and file handlesA file handle is a temporary reference number that is given to a file to be opened. Accessing and interacting with the file is via that reference number.), tuplea finite list of data, equivalent to a record or row in a database., arrayA set of data values of the same type, stored in a sequence in a computer program. Also known as a list. and functionA section of code that, when programming, can be called by another part of the program with the purpose of returning one single value..
Planning for system navigation
You should create appropriate navigation diagrams showing how the product will flow, or how interfaces can be accessed throughout the software. You can use an activity diagram to represent how your product will flow.
For example:
You will need to design plans for the user interface, be they form-based, text-based or GUIGraphical user interface - used to interact with a computer through icons and menus.. It is important to show how these will look, so you should include visual mock-ups of the user interface.
For example:
Planning for validation
All input from the end user must be validated. Your design plans should show how you plan to use length checkchecks that data isn't too short or too long., data typeThe format in which a variable or constant holds data, such as âintegerâ or âstringâ., format and range checkchecks that a value falls within a specified range, such as between one and ten or between 'a' to 'g'. checks along with error catching methods.
You should use pseudocode to demonstrate how user input will be validated to ensure that the data entered by a user is acceptable.
For example, an algorithm to validate the length of the user name could be represented as:
1 LENGTH = 51
2 WHILE LENGTH >= 51:
3 INPUT NAME
4 LENGTH =LENGTH(NAME)
5 PRINT NAME ACCEPTED
Algorithm dry run and refinements
When designing a solution, it is important that you test algorithms before implementation.
trace tableUsed when testing a program to record changes in variable values as code executes. can be created to test algorithms. A trace table follows the state of the variables during each line of execution in the program.
A trace table for the text validation algorithm would look like:
Line Number | Value of LENGTH | NAME | OUTPUT |
1 | 51 | ||
2 | 51 | ||
3 | 51 | INPUT NAME | |
4 | 206 | James Dr No From Russia with Love Goldfinger Thunderball You Only Live Twice | |
2 | 206 | James Dr No From Russia with Love Goldfinger Thunderball You Only Live Twice | |
3 | 206 | James Dr No From Russia with Love Goldfinger Thunderball You Only Live Twice | INPUT NAME |
4 | 5 | James | |
5 | 5 | James | NAME ACCEPTED |
Line Number | 1 |
---|---|
Value of LENGTH | 51 |
NAME | |
OUTPUT |
Line Number | 2 |
---|---|
Value of LENGTH | 51 |
NAME | |
OUTPUT |
Line Number | 3 |
---|---|
Value of LENGTH | 51 |
NAME | |
OUTPUT | INPUT NAME |
Line Number | 4 |
---|---|
Value of LENGTH | 206 |
NAME | James Dr No From Russia with Love Goldfinger Thunderball You Only Live Twice |
OUTPUT |
Line Number | 2 |
---|---|
Value of LENGTH | 206 |
NAME | James Dr No From Russia with Love Goldfinger Thunderball You Only Live Twice |
OUTPUT |
Line Number | 3 |
---|---|
Value of LENGTH | 206 |
NAME | James Dr No From Russia with Love Goldfinger Thunderball You Only Live Twice |
OUTPUT | INPUT NAME |
Line Number | 4 |
---|---|
Value of LENGTH | 5 |
NAME | James |
OUTPUT |
Line Number | 5 |
---|---|
Value of LENGTH | 5 |
NAME | James |
OUTPUT | NAME ACCEPTED |
- In lines 1 and 2, the length variable = 51.
- In line 3 the user is asked to input their name.
- In line 4, the length variable now equals the length of the user input. As the length is greater than 5, the code iterates back to line 2.
- Once again, in line 3, the user is asked to input a value. This time the user enters a value with 5 characters and the name is now accepted.