UML Weekend Crash Course⢠- To Parent Directory
UML Weekend Crash Course⢠- To Parent Directory UML Weekend Crash Course⢠- To Parent Directory
Session 24—Modeling the Development Environment 247 Defining the Notation for Packages and Package Diagrams The package icon looks like a tabbed folder. Packages reference one another using the dependency notation, a dashed arrow. Read the example in Figure 24-2 as “the Receiving subsystem depends on, or needs help from, the Purchasing subsystem package.” Purchasing Receiving Figure 24-2 Package icon and dependency notation Package stereotypes In Figures 24-1 and 24-2, each package icon contains a stereotype like or . You can put almost anything you want in a package, so the package description often requires a bit of clarification. The stereotype allows you to characterize the contents of the package and still provide specific naming of its contents. For example, the Receiving package is characterized as a subsystem. This prevents us from interpreting it as the directory containing the receiving documents, or some other resources besides the subsystem classes. Be careful though. Stereotypes are not part of the package name, so they do not help make it unique. Two packages at the same level called Receiving and Receiving would be in conflict and probably would not be allowed by most modeling tools. On the other hand, if the packages themselves are contained within other packages, then they are qualified by their containers, making them unique. However, you need to check how your modeling tool implements these rules. Package dependency Figure 24-2 also shows a dashed dependency arrow from Receiving to Purchasing. The dependency relationship means that at least one class in a package has to communicate with at least one class in the other package. The dependency in Figure 24-2 could mean that the Receipt class in the Receiving package (Receiving :: Receipt) needs to be able to get the details of the PurchaseOrder class in the Purchasing package (Purchasing :: PurchaseOrder) in order to validate incoming products. It is entirely valid for a dependency to run both directions, indicated by an arrowhead on both ends of the dashed line. Figure 24-3 shows an example where Shipping might need to update an Order in the Order Processing subsystem. But Order Processing might also need to check the status of a Shipment containing the Products on an Order.
248 Sunday Morning Shipping Order Processing Figure 24-3 A bi-directional dependency For simplicity’s sake, all the other dependencies illustrated in this session go only one direction. Dependency stereotypes The package dependency may be labeled with a stereotype to describe the nature of the dependency. The UML defines two dependency stereotypes, and . The stereotype in Figure 24-4 means that the Receiving package adds a Purchasing class (in this case the PurchaseOrder class) to itself at run time, allowing internal references (references within the package) to the class without specifying the source package name. Purchasing Receiving Figure 24-4 The stereotype on a dependency Tip For Java programmers, the stereotype has the same effect as the import statement in Java. The stereotype in Figure 24-5 says that the Shipping subsystem will want to communicate with the Receiving subsystem but will not actually pull the classes from Receiving into Shipping at run time. At run time, you would then expect to see some object from the Shipping subsystem making calls in the interface of the Receiving subsystem. Receiving Shipping Figure 24-5 The stereotype on a dependency Tip There are a number of other stereotypes described in the UML specification in the file 01-09-78 UML 1.4 Appendix A UML Standard Elements.pdf.
- Page 219 and 220: 196 Saturday Evening pointing towar
- Page 221 and 222: 198 Saturday Evening :OrderFullfill
- Page 223 and 224: 200 Saturday Evening Scenario 5, in
- Page 226 and 227: SESSION 20 Modeling the Dynamic Vie
- Page 228 and 229: Session 20—Modeling the Dynamic V
- Page 230 and 231: Session 20—Modeling the Dynamic V
- Page 232 and 233: Session 20—Modeling the Dynamic V
- Page 234: Session 20—Modeling the Dynamic V
- Page 238 and 239: Part V — Sunday Morning Session 2
- Page 240 and 241: SESSION 21 Applying the Basic State
- Page 242 and 243: Session 21—Applying the Basic Sta
- Page 244 and 245: Session 21—Applying the Basic Sta
- Page 246 and 247: Session 21—Applying the Basic Sta
- Page 248: Session 21—Applying the Basic Sta
- Page 251 and 252: 228 Sunday Morning receivePmt(amt)[
- Page 253 and 254: 230 Sunday Morning Figure 22-4 repr
- Page 255 and 256: 232 Sunday Morning A substate is a
- Page 257 and 258: 234 Sunday Morning Monitor when tem
- Page 260 and 261: SESSION 23 Applying the Extended St
- Page 262 and 263: Session 23—Applying the Extended
- Page 264 and 265: Session 23—Applying the Extended
- Page 266 and 267: Session 23—Applying the Extended
- Page 268 and 269: SESSION 24 Modeling the Development
- Page 272 and 273: Session 24—Modeling the Developme
- Page 274 and 275: Session 24—Modeling the Developme
- Page 276 and 277: Session 24—Modeling the Developme
- Page 278 and 279: SESSION 25 Modeling the Static View
- Page 280 and 281: Session 25—Modeling the Static Vi
- Page 282 and 283: Session 25—Modeling the Static Vi
- Page 284 and 285: Session 25—Modeling the Static Vi
- Page 286 and 287: SESSION 26 Modeling the Static View
- Page 288 and 289: Session 26—Modeling the Static Vi
- Page 290 and 291: Session 26—Modeling the Static Vi
- Page 292 and 293: Session 26—Modeling the Static Vi
- Page 294 and 295: Session 26—Modeling the Static Vi
- Page 296 and 297: PART # V Sunday Morning Part Review
- Page 299 and 300: PART VI Sunday Afternoon Session 27
- Page 301 and 302: 278 Sunday Afternoon design, and mo
- Page 303 and 304: 280 Sunday Afternoon :User :Web Br
- Page 305 and 306: 282 Sunday Afternoon studied Java p
- Page 307 and 308: 284 Sunday Afternoon and time. A JS
- Page 310 and 311: SESSION 28 Analysis and Architectur
- Page 312 and 313: Session 28—Analysis and Architect
- Page 314 and 315: Session 28—Analysis and Architect
- Page 316 and 317: Session 28—Analysis and Architect
- Page 318 and 319: Session 28—Analysis and Architect
Session 24—Modeling the Development Environment 247<br />
Defining the Notation for Packages and Package Diagrams<br />
The package icon looks like a tabbed folder. Packages reference one another using the<br />
dependency notation, a dashed arrow. Read the example in Figure 24-2 as “the Receiving<br />
subsystem depends on, or needs help from, the Purchasing subsystem package.”<br />
<br />
Purchasing<br />
<br />
Receiving<br />
Figure 24-2<br />
Package icon and dependency notation<br />
Package stereotypes<br />
In Figures 24-1 and 24-2, each package icon contains a stereotype like or<br />
. You can put almost anything you want in a package, so the package<br />
description often requires a bit of clarification. The stereotype allows you to characterize<br />
the contents of the package and still provide specific naming of its contents. For example,<br />
the Receiving package is characterized as a subsystem. This prevents us from interpreting it<br />
as the directory containing the receiving documents, or some other resources besides the<br />
subsystem classes.<br />
Be careful though. Stereotypes are not part of the package name, so they do not help<br />
make it unique. Two packages at the same level called Receiving and<br />
Receiving would be in conflict and probably would not be allowed by most<br />
modeling tools. On the other hand, if the packages themselves are contained within other<br />
packages, then they are qualified by their containers, making them unique. However, you<br />
need to check how your modeling tool implements these rules.<br />
Package dependency<br />
Figure 24-2 also shows a dashed dependency arrow from Receiving to Purchasing. The<br />
dependency relationship means that at least one class in a package has to communicate<br />
with at least one class in the other package. The dependency in Figure 24-2 could mean<br />
that the Receipt class in the Receiving package (Receiving :: Receipt) needs to be able to<br />
get the details of the PurchaseOrder class in the Purchasing package (Purchasing ::<br />
PurchaseOrder) in order to validate incoming products.<br />
It is entirely valid for a dependency to run both directions, indicated by an arrowhead on<br />
both ends of the dashed line. Figure 24-3 shows an example where Shipping might need to<br />
update an Order in the Order Processing subsystem. But Order Processing might also need to<br />
check the status of a Shipment containing the Products on an Order.