Tuesday, November 3, 2009

Section 12.7. Black-Box and White-Box Component Views










12.7. Black-Box and White-Box Component Views






There are two views of components in
UML: a black-boxview and a white-box view. The black-box view shows how a component looks from the outside, including its required interfaces, its provided interfaces, and how it relates to other components. A black-box view specifies nothing about the internal implementation of a component. The white-box view, on the other hand, shows which classes, interfaces, and other components help a component achieve its functionality.


In this chapter, you've seen both black-box and white-box views. So, what's the difference in practical terms? A white-box view is one that shows parts inside a component, whereas a black-box view doesn't, as shown in Figure 12-20.



Figure 12-20. Black-box component views are useful for showing the big picture of the components in your system, whereas white-box views focus on the inner workings of a component



When modeling your system, it's best to use black-box views to focus on large-scale architectural concerns. Black-box views are good at showing the key components in your system and how they're connected. White-box views, on the other hand, are useful for showing how a component achieves its functionality through the classes it uses.


Black-box views usually contain more than one component, whereas in a white-box view, it's common to focus on the contents of one component.












No comments: