Wednesday, June 25, 2008

UML - Building Blocks

UML defines how the system or application can be represented visually in number of diagrams. The System's design is basically made of diagrams and the diagrams contain many related elements. A system's architecture and specification is shown with multiple diagrams. There are various diagrams which UML defines which can be used to show the system at various levels and views. All the diagrams and the elements in it constitute the model of the software system or application. The model is nothing but the blueprint of the system.

To understand UML, one needs to understand basic building blocks, rules guiding them and the common design concepts.

The building blocks (vocabulary of language) of UML are:
1. Things
2. Relationships
3. Diagrams
Lets go one by one to get a better picture...

Things are the elements of UML model which is used to build a model
There are four kinds of things in the UML
i) Structural things (nouns) - Classes, Interfaces, Collaborations, Use Cases, Active Classes, components and nodes
ii) Behavioral things (verbs) - Interaction (messages exchanged), State machine
iii) Grouping things (organisation of structural things) - Package
iv) Annotational things (documentation) - Annotations

Relationships are the elements which indicate how two or more things are related to each other. There are various relationships, which are:
i) Dependency (semantic relation) - indicates that change to one thing may affect the semantics of other thing. One of the commonly seen relation is Use-Dependency, where one thing uses other thing to perform certain action.
ii) Association (structural relation) - indicates whole and its part relationship
iii) Generalization (inheritence relation) - the specialized element (the child) are substitutable for objects of generalized element (the parent). In this way the child shares the structure and behavior of the parent.
iv) Realization - one classifier specifies the contract that another classifier gaurantees to carry out. This relationship can be found in two places: between interfaces and the classes or components that realize them, and between use cases and the collaborations that realize them.

Diagrams are the graphical representation using things and relationships to visualize a system with specific perspective. So a diagram is a projection into a system. In theory, a diagram may contain any combination of things and relationships. In Practice, however, a small number of common combinations arise, which are consistent with five most useful views that comprise the architecture of a software-intensive system. In UML1.0 there are nine such diagrams supporting this.
1. Class Diagram
2. Object Diagram
3. Use Case Diagram
4. Sequence Diagram
5. Collaboration Diagram
6. Statechart Diagram
7. Activity Diagram
8. Component Diagram
9. Deployment Diagram

Out of these Class Diagrams, Object Diagrams, Component Diagrams and Deployment Diagrams indicate the structural specification of the software system and the rest of the diagrams are useful in projecting the behaviour of the system.

Learning programming

    Programming is an interesting world where you apply your skills to build a software program that comes into life when it is run on a com...