Once the system requirements have been set, it’s time to start modeling the application. In this stage we can use some graphical representations, such as UML diagrams. The first step would be to create a use case diagram from those requirements, and next, we could expand each use case using an activity diagram.
A flow diagram is a graphical representation of a given process. Each step of the process is represented by a symbol which has a short description. Symbols are linked by arrows that show the process flow. This method has been used since 1930 in industrial engineering, and it was also adapted by Goldstine and Von Neumann to computer engineering, in 1947. It has evolved in recent years to the UML activity diagram.
The main components of an activity diagram are:
First of all, there is a note explaining that the user must be previously registered before trying to validate himself/herself. Then, the logic of this process is as follows:
This example shows the logic of searching and asking for a book in a library.
Exercise 1:
Analyze the example of Orders shown above, and write the explanation of this diagram following the same pattern than in previous examples.
Exercise 2:
Create an activity diagram for the following simple programs:
- A program that asks the user to enter a number and then tells if it is even or odd.
- A program that iteratively asks the user to enter a number until he types an odd number.
- A program that iteratively asks the user to enter a number until he types 0. Then, it will show the total amount of positive and negative numbers that the user has typed.
- A program that asks the user to enter his username and password. If they are not correct, the program must ask again, up to 3 times. After the 3rd attempt, the program will show an error message and then, it will finish.
Exercise 3:
Create the activity diagram of any use case from exercise about the cultural organization of previous section.