![class Diagram class model](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhreGt1Cf5zdRfUgevniRU9MxKbRjniY0dA6zNSKDNwt6WJWqzXhHFzfGQuN7efVPZAh9gsg9Qpq2NGhGLDWyhzyJtQX6Wt_WYB3hMWVLLP8S8LcBMkq04S8oUVUBFXbhcSrNotCMdq8vg/s72-c/classDiagramInheritance.jpg)
Class diagrams are the most popular UML diagrams used for construction of software applications. So it is very important to learn the drawing procedure of class diagram.
Class diagrams have lot of properties to consider while drawing but here the diagram will be considered from a top level view.
Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application. So a collection of class diagrams represent the whole system.
The following points should be remembered while drawing 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. Because unnecessary properties will make the diagram complicated.
Use notes wheneverrequired to describe some aspect of the diagram. Because 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 rework as many times as possible to make it correct.
Now the following diagram is an example of an Order System of an application. So it describes a particular aspect of the entire application.
First of all Order and Customer are identified as the two elements of the system and they have a one to many relationship because a customer can have multiple orders.
We would keep Order class is an abstract class and it has two concrete classes (inheritance relationship) SpecialOrder andNormalOrder.
The two inherited classes have all the properties as the Order class. In addition they have additional functions like dispatch () and receive ().
Reviews:
Post a Comment