Thursday, August 2, 2012

Use Case Diagram

A Use Case Diagram (UCD) is used to describe the functionality of a system or describe a set of actions that some system can perform with one or more external users of the system. That is, rather than representing the details of individual features of your system, UCDs depicts pictorially all the available functionality. Each action provides some observable and valuable result to the actors of the system.

However the UCDs cannot replace sequence diagrams or flow charts because they are fundamentally different. UCD cannot be used

-          When you wish to represent a sequence of steps needed to complete a task or when a error occurs. Use Sequence diagrams.

-          When flow should be depicted in a linear time based way. Use Flow charts.

Use case diagrams are used to specify:

-          External requirements on a subject, required usages of a system - to capture what a system under construction is supposed to do;

-          the functionality offered by a subject – what system can do;

-          Requirements the specified subject poses on its environment - by defining how environment should interact with the subject so that it will be able to perform its services.

UCDs have only 4 major elements

  1. The actor - specifies a role played by an external entity that interacts with the system, a human user of the designed system. All actors must have names according to the assumed role. Customer, Student, Passenger etc are sample actor names

  2. The system – Describe a system/subject that does some business process. Examples of systems:  Web Site, Payment System etc

  3. The use cases - Specifies behavior of a system by describing a set of sequences of actions performed by the system to yield an observable result of some value to actors of the system. Examples of use case names are Place Order, Update Subscription, Transfer Funds etc

  4. The lines - Represent relationships between different elements of UCD.

Pictorial representation of Major elements of the use case diagram is:

Image Credit : Google


Once you have studied the main components of UCD, now it is time to build one UCD. The initial step is to identify all of the high-level behavior of the system you wish to depict through the UCD. Once you have described details in a high-level way you should get an idea of how to draw UCD. At every stage of development, the UCD will depict a complete description of the system's functionality. It may lack some detail, but it should cover most features of system. And if functionality or behavior is added or deleted over the life of your project, the scope of the change you need to make is proportional to both the scope of the change in the system itself, and the maturity of your model. You can continue to add detail by decomposing your use cases into more use cases which are used by the top-level use cases. Below is how a sample Use Case and Flow Chart will look for driving a car.



Image Credit : Google




Image Credit : Google


To Conclude UCD are best diagrams when you wish to depicts behavior of the system or structural relationships.





Reference

http://www.uml-diagrams.org/use-case-diagrams.html

http://www.andrew.cmu.edu/course/90-754/umlucdfaq.html



No comments:

Post a Comment