Themes

Monday, August 24, 2015

UML - Unified Modeling Language

Recently, I was working on designing a new module. When designing, I wanted to have a clear view about what objects I wanted to create and how each object would be related to each other. Then I stumbled upon class diagrams in Unified Modeling Language (UML).

UML is NOT a new concept. This is something that I had learnt in college. However, never had a chance to use it until now. So for the design of this new model, me and my colleague decided to use UML for better clarity. That's where our journey into the world of UML began.

What is UML?
As the name suggests, UML is a modelling language. It is NOT a programming language nor is it a software development process.

When we say "Modelling Language", it means that you can model your data, objects, business process, use cases etc. using this language.

We have primarily used UML for object modelling with Class Diagrams.  But while refreshing my  understanding about UML, have seen multiple websites highlighting the importance of UML for Use-Case Modelling. 

Overview of UML Diagrams:
Class diagrams:
Sample Class Diagram
Sample Class Diagram

Image source: http://www.teach-ict.com/as_as_computing/ocr/H447/F453/3_3_6/uml/miniweb/pg7.htm

Here, in the above diagram, there are couple of classes defined. Like, Train and Train Journey.
Each of the classes have their attributes and their associated methods (or operations). 

Also, the diagram shows the relationship between the two classes - TrainJourney has a assigned Train, and Train has an assigned Train Journey.  Additional details are provided about the association - like 0 or more Train journeys are associated with 0 or 1 Train.

With a Class Diagram, it provides clarity as to how do you want to split your design into Classes (or Objects), theirs attributes, operations and associations with one-another.



UML tools:
There are various tools to model your design in UML. I have currently used two of the tools listed in [3] - StarUML and Umbrello

StarUML has a better and intuitive UI when compared to Umbrello. Star UML is not free. I have tried only an evaluation version and thats pretty good.

Umbrello, being an open source utility, allows one to create class diagrams and associations. Additionally, it also allows you to generate the code in Java, Python, among others, based on the Class Digram created.


References:
[1]http://www.uml.org/
[2]https://en.wikipedia.org/wiki/Unified_Modeling_Language
[3]https://en.wikipedia.org/wiki/List_of_Unified_Modeling_Language_tools

No comments:

Post a Comment