Monday 15 March 2010

Software Engineering – Activity Diagrams

Its time to demonstrate how to produce an Activity Diagram – here we go.


What is their purpose?


The purpose of an activity diagram is to represent data and activity flows in an application.

The components


Within an activity diagram there are many key modelling concepts, here is a select main few of them:

  • image An activity represents an action or a set of actions to be taken.

  • image This is a control flow. It shows the sequence of execution.

  • image This is the initial start node – the beginning of the set of actions (the start basically)

  • image This is the Final node. It stops all flow in an activity diagram.

  • image This is a decision node. It represents a test condition – much like an IF statement.


Example time


A basic example of an activity diagram is like the one that follows:

image

This is an Activity Diagram for a library user who wishes to make a transaction. This can be one of two things – either returning a book, or loaning a book.

Here are the steps:


  • The user walks up to the librarian (initial node) who then gets the users information – probably from a library card i guess, hehe.


  • If this is a new user, then we need to take the right branch, and create this user an account, listing their details. Other wise, this user already exists so we take the left branch. This is via the decision node.


  • The next activity is the activity of actually making the transaction, however since this is one of two things, then we need another decision node.


  • From this decision node, if we go left, then the user is returning a book, other wise right is the activity of loaning a book.


  • Finally we come to the final node, where we stop progressing any further, and the user leaves the library :)

No comments:

Post a Comment