UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory UML Weekend Crash Course™ - To Parent Directory

crnarupa.singidunum.ac.rs
from crnarupa.singidunum.ac.rs More from this publisher
01.01.2015 Views

Session 25—Modeling the Static View: The Component Diagram 261 OrderProcessing::OrderInterface OrderEntryUI.exe OrderProcessing::Order OrderInterface OrderEntry.exe 1..1 1..* OrderProcessing::LineItem 0..1 1..1 Purchasing::Product Figure 25-10 The OrderEntry.exe is created from multiple source classes. Quite often, however, a component consists of a single class implemented as an executable, file, library, table, or document. In Figure 25-11, the order entry executable references a set of library components for the individual classes rather than compiling the classes into one component. The user interface application is broken into two html components. The result is a more modular design. index.html OrderEntry.exe OrderInterface orderentry.html dbinterface.dll order.dll product.dll Figure 25-11 One class equals one component. Finally, components can be organized into packages just like other diagrams and model elements. This can be very helpful when managing application distribution. The result is a directory containing all the software elements needed to implement the system or subsystem represented by the package.

262 Sunday Morning REVIEW The purpose of the Component diagram is to define software modules and their relationships to one another. Each component is a chunk of code that resides in memory on a piece of hardware. The UML groups components into three broad categories: Deployment components, which are required to run the system Work product components including models, source code, and data files used to create deployment components Execution components, which are components created while running the application The component icon is a rectangle with two small rectangles on the left edge. The interface to the component may be modeled two different ways: The lollipop notation represents the interface as a small circle connected to the component by a solid line and with the name of the interface near the circle. The second method uses a class with the stereotype with a realizes relationship drawn from the component to the interface class. A component may realize (implement) as many interfaces as it requires. QUIZ YOURSELF 1. What is a UML component (See “Explaining the Component Diagram.”) 2. What is the icon for a UML component (See “Defining the Notation for Components and Component Dependencies.”) 3. What notation shows that one component needs access to another component (See “Defining the Notation for Components and Component Dependencies.”) 4. What notation is used to show that a component implements an interface (See “Defining the Notation for Components and Component Dependencies.”) 5. True or False: Each component implements a class. (See “Mapping the Logical Design to the Physical Implementation.”)

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

<br />

OrderProcessing::OrderInterface<br />

<br />

OrderEntryUI.exe<br />

OrderProcessing::Order<br />

OrderInterface<br />

<br />

OrderEntry.exe<br />

<br />

<br />

<br />

1..1<br />

1..*<br />

OrderProcessing::LineItem<br />

0..1<br />

1..1<br />

Purchasing::Product<br />

Figure 25-10 The OrderEntry.exe is created from multiple source classes.<br />

Quite often, however, a component consists of a single class implemented as an executable,<br />

file, library, table, or document. In Figure 25-11, the order entry executable references<br />

a set of library components for the individual classes rather than compiling the<br />

classes into one component. The user interface application is broken into two html components.<br />

The result is a more modular design.<br />

index.html<br />

<br />

OrderEntry.exe<br />

OrderInterface<br />

orderentry.html<br />

<br />

dbinterface.dll<br />

<br />

order.dll<br />

<br />

product.dll<br />

Figure 25-11 One class equals one component.<br />

Finally, components can be organized into packages just like other diagrams and model<br />

elements. This can be very helpful when managing application distribution. The result is a<br />

directory containing all the software elements needed to implement the system or subsystem<br />

represented by the package.

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

Saved successfully!

Ooh no, something went wrong!