Component Diagrams in UML, Page 2
Case Study—Courseware Management System
From our above discussion of the Component diagram, we will apply the criteria for identifying components to the Courseware Management System. In the first instance, the application may seem to be too simplistic to contain components. But wait! The Courseware Management System has its own share of components, some implicit in the design.
Before we move to identifying the components, let us recap a quick discussion that we had regarding the Model View Controller architecture in the UML Class Diagram Part II article. In this article we had mentioned that the different classes in the class diagram can be partitioned along the lines of the three layers of this architecture viz. Model, View, and Controller. This partitioning of the different classes of the application poses its own challenges, the primary one being how do the classes in one layer interact with the classes in the other layers. Let us elaborate this by reviewing the classes in the Courseware Management System.
Identifying Components in the Courseware Management System
The different classes that we have modeled for the Courseware Management System, such as CourseAdministrator, Course, Topic, CourseCalendar, and Student that fall in the Model layer need to provide a consistent interface to enable other classes and components to interact with them and utilize their services. We can as well define our own set of simple interface methods to access these services. But, to enable our application components to be used by external applications, we can consider basing the components on well-defined component standards.
Hence, based on the technology that you use, you would model these as, maybe Enterprise JavaBeans (EJBs) or Component Object Model/Distributed Component Object Model (COM/DCOM) components. EJB and COM/DCOM are nothing but industry-standard component models that you can base your application component design on. This becomes the "physical" implementation of the logical class diagram. An added advantage of basing your application components on these component models is that your components become "reusable!"
So, if we had introduced a controller class for the application named CMSController, it would interact with the components in the Model layer via the EJB or the COM/DCOM interfaces.
Based on this, let us now draw the components in the Model layer for the Courseware Management System.
Figure 2 Component diagram for the Courseware Management System
Figure 2 shows the Component diagram for the Model layer of the Courseware Management System. The diagram shows the different components, such as CourseAdministrator, Course, Topic, Tutor, and so forth in the Model layer and how the Controller layer component interacts with these components. The diagram also depicts a database access component that represents a library component that the Model layer components will use to interact with a database.
In this article, we briefly discussed Component diagrams. In the next article, we will cover the last UML diagram—the Deployment diagram.
About the Authors
Mandar S. Chitnis, Lakshmi Ananthamurthy, and Pravin S. Tiwari are the co-founders of Novusware, Inc. They have co-authored the book Teach Yourself BEA WebLogic Server 7.0 in 21 Days (SAMS Publishing, October 2002) based on the recently launched WebLogic Server 7.0 by BEA Systems, Inc.
For any questions or queries regarding the article contents, please contact firstname.lastname@example.org.