How to draw Component Diagram?
Component diagrams are used to describe the physical artifacts of a system. This artifact includes files, executables, libraries etc.
So the purpose of this diagram is different, Component diagrams are used during the implementation phase of an application. But it is prepared well in advance to visualize the implementation details.
Initially the system is designed using different UML diagrams and then when the artifacts are ready component diagrams are used to get an idea of the implementation.
This diagram is very important because without it the application cannot be implemented efficiently. A well prepared component diagram is also important for other aspects like application performance, maintenance etc.
So before drawing a component diagram the following artifacts are to be identified clearly:
• Files used in the system.
• Libraries and other artifacts relevant to the application.
• Relationships among the artifacts.
Now after identifying the artifacts the following points needs to be followed:
• Use a meaningful name to identify the component for which the diagram is to be drawn.
• Prepare a mental layout before producing using tools.
• Use notes for clarifying important points.
The following is a component diagram for order management system. Here the artifacts are files. So the diagram shows the files in the application and their relationships. In actual the component diagram also contains dlls, libraries, folders etc.
In the following diagram four files are identified and their relationships are produced. Component diagram cannot be matched directly with other UML diagrams discussed so far. Because it is drawn for completely different purpose.
So the following component diagram has been drawn considering all the points mentioned above: