There are many experienced developers who, despite writing code for many years, have never used tools such as UML Diagrams. I used to be one of these guys who had never used those diagrams, even though I was aware of their existence. These diagrams are a process which allows a developer to depict his code structure in to a commonly accepted form among programmers who are going to develop this code.
The truth is that this process tends to be grinding sometimes, especially in case that your classes are many and complex. You need a tool that will help you work quickly and efficiently, so as to build your whole diagram.
The first one is a tool with GUI that enhances productivity. At the very beginning, you are going to notice, it is not so easy to use it but you are going to be faster in the course of the time.
On the contrary, Plantuml-Viewer gives the possibility to everyone to draw his class diagram by typing. In this case the curve of learning is certainly bigger but at the end you are going to be equally fast, or more, as the first application.
I took the above example from zentut. You can read the full tutorial in the previous link but I am going to give you a quick review. The above diagram presents a class named BankAccount. This class contains private parameters, accountNumber and totalBalance. the “-“ in front of a param declares that the param is private.
After the dividing line there are methods. These methods are public because have the “+” operator. Continuing with the other two classes CheckingAccount & SavingAccount. The first one has a private parameter named fee and a public method named deductFee(). The second class contains an private parameter intestRate and a public method named addInterest(). CheckingAccount class inherits from the BankAccount class and the same happens to SavingAccount class as well.
One day, when I had finished developing a new feature, a colleague urged me to use one of those diagrams. So I started to build the structure and move it from paper to a synchronous medium using Umlet.
It took me a lot of time to draw and link the appropriate classes with each other. Sometimes, I thought of quitting but I pushed myself to continue so as to have a completed opinion about that. I didn’t regret it.
I was thinking that it was a great opportunity to write down the whole infrastructure and functionality of my code. It would be great because using this diagram, explanation of the code would become a “piece of cake”. Besides that, it would be very useful for me if I wanted to add new functionalities to the same feature after a long time.
It is true that after a long time nobody is going to remember the full implementation of his code or even the structure of it. So, uml diagram gives the ability to recall your code if it is written by you or to understand it if it is written by someone else in order to make a plan on how to append the new feature making the code reusable (that’s called DRY or Don’t Repeat Your Self).
Not long after, my boss asked me to implement a new component. Then I realized I didn’t have a clear picture of how I had developed my code. It was going to waste my time searching all components of my code. I was surprised by the usability of the uml diagram. In a short amount of time I had recalled all my code and adapted my new component to the pre-existing code.
[section_title align=”center” text=”Conclusion”]
To sum up, it is very useful to have tools which help you to keep track of or log the whole logic of the code at your service. It is going to be rather helpful for you and for anyone who is going to take part in the development.
Needless to say, using tools such as UML Diagram enhances your comprehension of building a better structure of code.
Yes, that’s true, it tends to be difficult at first but after some practice it is going to help you, reducing the development time.
Last but not least, UML Diagram improves the communication among developers.