01.01.2015 Views

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Session 25—Modeling the Static View: The Component Diagram 257<br />

Component interfaces<br />

A component interface may be modeled in either of two ways. One way is to use a class with<br />

the stereotype attached to the component with a realization arrow, as<br />

shown in Figure 25-2. The realization arrow looks like the generalization symbol with a<br />

dashed line. <strong>To</strong> realize the interface means to apply it to something real like the executable.<br />

<br />

OrderEntry.exe<br />

<br />

Order<br />

Figure 25-2 Interface notation using a class and stereotype<br />

A second, more common, technique is to use a “lollipop” attached to the component<br />

with a solid line, as shown in Figure 25-3. If you look into the <strong>UML</strong> specification examples,<br />

the circle on the end of the lollipop is very small. This is a bit distorted from the typical<br />

notation employed by modeling tools.<br />

<br />

OrderEntry.exe<br />

OrderInt<br />

Figure 25-3 Interface notation using the lollipop<br />

The interface implemented by a component is actually implemented by the classes within<br />

the component, so the interface should already have been defined in your Class diagrams.<br />

Also, a component may implement as many interfaces as it requires. The number and exact<br />

type of interfaces are dictated by the classes implemented by the component.<br />

Component dependencies<br />

Dependencies between components are drawn with the dashed arrow from the dependent<br />

component to the component it needs help from. In Session 24, you learned that package<br />

dependencies could be stereotyped to clarify the nature of the dependency. The same is true<br />

for component dependencies. In Figure 25-4, the OrderEntry depends on the OrderEntry.exe<br />

component. The <strong>UML</strong> stereotype means that the OrderEntry file literally<br />

becomes the OrderEntry executable at runtime. OrderEntry would be the code sitting on a<br />

storage device. At runtime it is loaded into memory and possibly even compiled. Then during<br />

execution the OrderEntry.exe component would depend on the three other components:<br />

orders.dll, inventory.dll, and orders.tbl.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!