Section 12.5. Classes That Realize a Component


12.5. Classes That Realize a Component

A component often contains and uses other classes to implement its functionality. Such classes are said to realize a componentthey help the component do its job.

You can show realizing classes by drawing them (and their relationships) inside the component. Figure 12-12 shows that the BlogDataSource component contains the Blog and EnTRy classes. It also shows the aggregation relationship between the two classes.

You can also show a component's realizing classes by drawing them outside the component with a dependency arrow from the realizing class to the component, as shown in Figure 12-13.

Figure 12-12. The Blog and Entry classes realize the BlogDataSource component


Figure 12-13. Alternate view, showing the realizing classes outside with the dependency relationship


The final way to show realizing classes is to list them in a <<realizations>> compartment inside the component, as shown in Figure 12-14.

Figure 12-14. You can also list the realizing classes inside the component


How do you decide which notation to use to show the classes that realize a component? You may be limited by your UML tool, but if you have the choice, many modelers prefer the first notation (drawing the realizing classes inside) rather than drawing them outside since drawing them inside visually emphasizes that the classes make up a component to achieve its functionality. Listing the realizing classes may be helpful if you want something compact, but keep in mind that it can't show relationships between the realizing classes, whereas the first two notations can.




Learning UML 2.0
Learning UML 2.0
ISBN: 0596009828
EAN: 2147483647
Year: 2007
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net