Class and Object Diagram
Class and Object Diagram
OBJECT DIAGRAM
By: SELSHA C S
CLASS DIAGRAM:
A class diagram shows a set of classes, interfaces, and collaborations and their
relationships.
A class diagram is a diagram describing the structure of a system.
Most common diagram found in modeling object-oriented systems.
Addresses the static design view of a system.
Class diagram that include active classes address the static process view of system.
● The top box has the class name.
● The middle one has the
attributes/properties/data members
● The lower one has the
behaviour/member
functions/methods.
HOW TO DRAW A CLASS DIAGRAM?
● The name of the class diagram should be meaningful to describe the aspect of the system.
● Each element and their relationships should be identified in advance.
● Responsibility(attributes and methods) of each class should be clearly identified.
● For each class, minimum number of properties, should be specified, as unnecessary
properties will make the diagram complicated.
● Use notes whenever required to describe some aspect of the diagram. At the end of the
drawing it should be understandable to the developer/coder.
● Finally, before making the final version, the diagram should be drawn on plain paper and
reworked as many times as possible.
WHERE TO USE CLASS DIAGRAM:
● First, analyze the system and decide which instances have important data and association.
● Second, consider only those instances, which will cover the functionality.
● Third, make some optimization as the number of instances are unlimited.
Before drawing an object diagram, the following things should be remembered and understood
clearly −
● Object diagrams consist of objects.
● The link in object diagram is used to connect objects.
● Objects and links are the two elements used to construct an object diagram.
After this, the following things are to be decided before starting the construction
of the diagram −
● The object diagram should have a meaningful name to indicate its purpose.
● The most important elements are to be identified.
● The association among objects should be clarified.
● Values of different elements need to be captured to include in the object
diagram.
● Add proper notes at points where more clarity is required.
WHERE TO USE OBJECT DIAGRAMS: