Hello All
Today I will go through with UML class diagram. It’s like old wine in old bottle ;) . We all know that these are very basic but now a days people just stat to do coding without making any class or activity diagram, so eventually they fall in a design related issue if the system becomes huge.
Again UML is more impotent to understand any complex system which is properly documented in UML diagram.UML makes our life simple through notifying us the design fault.
So let’s start the old song again.
Class:
Generally there are 3 components in the class icon as following.
1. Class Name
2. Attributes
3. Functions / Methods
Visibility:
Visibility of class diagram represents the accessibility of the class members. Visibility notations are as bellow .
Notations | Access type |
– | Private |
+ | Public |
~ | Protected |
Association:
When two objects are connected with each other then it can be represent as association. For students and seminar we can use association notation where students are attending in seminar.
Multiplicity indicates the countable objects relation with other objects.
Indicator | Meaning |
0..1 | Zero or one |
1 | One only |
0..* | Zero or more |
1..* | One or more |
n | Only n (where n > 1) |
0..n | Zero to n (where n > 1) |
1..n | One to n (where n > 1) |
Composition:
Composition represents with a black diamond. It represents that a component strongly depends on another component. Suppose we have two objects one is circle and another is point. In that case a circle consists of many points.
Aggregation:
When an object form with another object(s) but not mandatory to form the main object then its denoted by a diamond. Suppose student and school object can represent with aggregation relationship.
Inheritance:
When one object inherits property from any parent object then the sign denoted with a triangle shape arrow.
Thanks
That’s all for the day.
BYE