Association differs from aggregation only in that it does not imply any containment.Ī window class contains a list of its shapesĪ car has it’s tiers, and the scope of tyre doesn’t depend on a car since a tyre can be used for another car alsoĪ Rectangle class has its style, which may be shared by other shapes also life time of style doesn’t depend on Rectangle class.Ĭomposition is the stronger form of aggregation. You may have confusion between aggregation and association. One class depends on another if the independent class is a parameter variable or local variable of a method of the dependent classĪggregation can occur when a class is a collection or container of other classes, but where the contained classes do not have a strong life cycle dependency on the container-essentially, if the container is destroyed, its contents are not. One object is aware of another it contains a pointer or reference to another object. “1.*” One or more instances (at least one) “0.1” No instances, or one instance (optional, may) In a system a class may be related to different classes,following are the different relation ship. “Out” The parameter is an output parameter.ġ) Static members are represented as underlined.Ģ) Pure virtual functions are represented as italics. “Inout” The parameter is capable of both input and output. “in” The parameter is an input parameter. This post is meant for such people also it will be helpful for beginners, here I will explain the class diagram with C++ class example.Ĭlass diagram for the above class is shown below.ĭifferent visibility of the class can be represented as As you know a Class diagram is a diagram showing different classes in a system their attribute, operation and the relationship among different objects.Įven I have been using it for long time I always had confusion each time when I use it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |