Monday, January 28, 2013

UML Diagrams overview and Relationship.


“A picture is worth a thousand words”.
 In software Industry, communication plays a very important role. Solution of UML diagram really fits on that.UML stands for Undefined Modeling Language. It represents the whole software system in pictorial language using different diagrams.
All   diagrams can be categorized as follows,


Elements can not exist along. There are some kinds of relationships among those elements. There are,
  •         Generalization
  •         Association
  •     Dependency    



Generalization:
It is also called as Inheritance. It represent the “Is a” relationship. It is denoted by “ "
Example:-
Saving Account is an Account.

UML diagram:-
               
            







Java Implementation:
Class Account{
}
Class SavingAccount extends Account{
}



Association:-

It represents “has a” relationship. If there is one way Association that has an only one class is denoted by  ““  and if it is bi- directional or multi- directional, it is denoted by “  “.

Example01:-
                Student has a book.
UML Diagram:-

 


Java Implementation:-
            Class Student{
                Book myBook;
}
Class Book{
}

Example02:-
                A student has 1 or more books.

UML Diagram:
               
Java Implementation:-
            Class Student {
                Book[] myBook;
}
Class Book{
                Student ownStudent;
}


Dependency:-
It represents the “Uses a” Relationship and It is denoted by “ “.
Example:-
Shelf use books

UML Diagram:-




Java Implementation:-
             Class Shelf{
                        Public string placeOrder(Book mybook){
           # returns the location of book according to the book
}
}
Class Book{
}

                    
Next post will continue the diagrams.                    

No comments:

Post a Comment

The Hypervisor

 The hypervisor is a piece of software that runs on top of hardware infrastructure that creates a virtualization platform. The hypervisor a...