Showing posts with label UML. Show all posts
Showing posts with label UML. Show all posts

Monday 5 March 2012

UML Tutorial

Introducing the UML

The Unified Modeling Language or UML is a standard  language for specifying, visualizing, constructing, and documenting the  software systems.
•The UML uses mostly graphical notations to express the design of software projects.
•UML describes a notation and not a process. 
•UML model describes what a system is supposed to do. It does not tell how to implement the system.

Uml diagrams
In  UML certain number of graphical elements combined into diagrams.
•Because it is a language, the UML has rules for combining these elements.
•Uml consists of eight basic diagram 
  1.      Class Diagram
  2.      Object Diagram
  3.      Component Diagram
  4.      Deployment Diagram
  5.      Use Case Diagram
  6.      Collaboration Diagram
  7.      Activity Diagram
  8.      State Diagram
Class Diagram
•It is used to describe the structure of a class including the properties and methods and the relationship between the classes.
         
Notations

 class












Relationship between classes

Aggregation ->line with a hollow diamond
Composition ->line with a filled diamond
Generalization-> line with a hollow arrow head
realization->dashed line with a hollow arrow head
Association->line connecting two classes

Object diagram

It is used to describe the system at a particular point of time.
     
 Notations
 Objects
      objects are the instance of class.

Association
       it represents the association between the objects

Component Diagram

•It is used to describe the dependency  between various software components.
     
  Notations
Component  ->represents a software entity in a system.

 





Dependency ->represents the relationship between the components.
 
 
Deployment Diagram

•It is used to represent the hardware used to implement the system and  association between hardware components.
Notation
Components->represents the software entity.






Node ->represents a piece of hardware in a system.




  
  





 Association->represents the communication between hardware components 

example



















Use case diagram
•It identifies the functionality provided by the system (use case) ,the users that interact with the system (Actor) and the association between the user and functionality.

Notations
        use case->functionality provided by the system







Actor-> user or another system that interact with the use case








Association -> link actors with the use case
 
example shows a user placing an order with a sales company might follow these steps.
 



















State Diagram

It represents the various state an object can go through and event that cause the state transition.
      Notations
     state ->





Transition-> represent the  changing object state caused by events





Initial State -> state of an object before transition 





Final State ->represent the destruction of an object.





State diagram of a light









Activity Diagram
•It is used to represent the work flow with in a system.
•It shows steps (activities) ,decision point and branch
Notations
–Activity->each step in a work flow
 









–Initial state->entry point

  



Final state->end of work flow
 


–Transition ->
 



–Decision ->represent a condition







Activity diagram to find the factorial of a number















Collaboration Diagram


It represent the interaction between the objects.
Notations
 Object->
 Message->tells the receiving object to execute one of its operation






Actor->communicate with the object





example:

Administrator use a web application to manage user account
 

Find User
   LookUpUser
Update User
   ValidateUser
   UpdateUser

 
Conclusion

It is  independent of particular programming languages.
•It encourage the growth of the OO tools market.