Skip to main content

Posts

Showing posts from May, 2014

UML 2.0 - Class diagram and different relations

Lately I had a hard time to understand different notations used in UML 2.0 to represent relationship between classes in a class model. Though I have experiences in programming and designing, it did not help much. Therefore to enhance this knowledge I did some research on internet and also read a beautiful book on UML 2.0 by Martin Fowler . Indeed it helped me a lot and here goes some of my interpretation on Class modeling based on UML notations. UML 2.0 defines standard notations to indicate relationship between the classes. The class diagram is necessary while designing behavior of a component. Also helps a lot in TDD to scribble some design before start coding. The relationship between classes can be defined as below, Relationship that is defined at instance level , are of three type. Relation that is defined at instance level can be considered as a run-time relation. These relations are realized and contributed at run-time. Association: It defines the abstract form of a relat...

Code maintainability index

How do you measure that your code is maintainable? There is no such standard measure exists in IT industry that indicates that your code is maintainable. However there can be several disciplines which you can use to interpret maintainability of your code. One way of arriving to this is to identify different high priority code metrics and summarization of weightage of each of those metrics. For example look at the below calculation, Code Metrics Weightge in % Code coverage 50 Cyclomatic Complexity 20 Duplicates 10 Coupling 10 Large Class 5 Large Methods 5 Total 100      The above table illustrates the weightage derived from each metrics considered to calculate the maintainability index of software. The weightage can be calculated based on the target metrics you have defined for each item on the list. This calculation is quite interesting and c...