UML Weekend Crash Course⢠- To Parent Directory
UML Weekend Crash Course⢠- To Parent Directory UML Weekend Crash Course⢠- To Parent Directory
Session 21—Applying the Basic Statechart to the Case Study 221 Applying the Basic Statechart Diagram Notation to the Case Study Now it’s time to bring all these concepts together to construct the Statechart for one of the case study objects. This time I use the Product. The problem statement below adds a little more information so that you can exercise the Statechart notation you’ve learned so far. Inventory control: Problem statement Products are first entered into our system when they are ordered using a purchase order (P.O.). Each product keeps a record of the originating P.O. When the product is received, it is placed into inventory by recording the location where it is placed. When the product is received, you have to update the P.O. to indicate that you have received the product. When a product is sold, the product tracks the order to which it belongs. When a product is sold, it is also packed for shipping and the associated shipment is recorded. When the product is shipped, you need to record the shipper and the date it was picked up. Occasionally, a product is returned. In that case, you put the product back into inventory and record the location. Constructing the Statechart diagram for the product object “Products are first entered into our system when they are ordered using a purchase order (P.O.). Each product keeps a record of the originating P.O.” The initial state is On Order. The action is to record the purchase order. Notice in Figure 21-5 that an action may be associated with the creation of the object. / setPO(PO) On Order Figure 21-5 Model the initial state of the product.
222 Sunday Morning “When the product is received, it is placed into inventory by recording the location where it is placed. When the product is received, you have to update the P.O. to indicate that you have received the product.” Figure 21-6 shows that the transition from On Order to Inventoried is triggered by the receive event. The associated actions are to update the purchase order object with the product and quantity received and update the product with the inventory location. On Order entry:setPO(PO) receive / PO.receiveProduct(Product, qty) inventory(location). Inventoried Figure 21-6 Inventory the product and update the P.O. “When a product is sold, the product tracks the order to which it belongs.” Figure 21-7 shows the sell event triggering the transition to the sold state and the action to record the Order that now holds the product. Inventoried sell/ setOrder(Order) Sold Figure 21-7 Sell the product and record the order.
- Page 194 and 195: Session 16—Modeling the Dynamic V
- Page 196 and 197: Session 16—Modeling the Dynamic V
- Page 199 and 200: PART III # Saturday Afternoon Part
- Page 201 and 202: PART IV Saturday Evening Session 17
- Page 203 and 204: 180 Saturday Evening Scenario 1 Get
- Page 205 and 206: 182 Saturday Evening The next step
- Page 207 and 208: 184 Saturday Evening For Scenario 2
- Page 209 and 210: 186 Saturday Evening For subsequent
- Page 211 and 212: 188 Saturday Evening 6:addProduct(c
- Page 213 and 214: 190 Saturday Evening 7:addProduct(c
- Page 215 and 216: 192 Saturday Evening REVIEW The Col
- Page 217 and 218: 194 Saturday Evening Scenario 1 Get
- 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 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 270 and 271: Session 24—Modeling the Developme
- 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
222<br />
Sunday Morning<br />
“When the product is received, it is placed into inventory by recording the location<br />
where it is placed. When the product is received, you have to update the P.O. to indicate<br />
that you have received the product.” Figure 21-6 shows that the transition from On Order to<br />
Inventoried is triggered by the receive event. The associated actions are to update the purchase<br />
order object with the product and quantity received and update the product with the<br />
inventory location.<br />
On Order<br />
entry:setPO(PO)<br />
receive /<br />
PO.receiveProduct(Product, qty)<br />
inventory(location).<br />
Inventoried<br />
Figure 21-6 Inventory the product and update the P.O.<br />
“When a product is sold, the product tracks the order to which it belongs.” Figure 21-7<br />
shows the sell event triggering the transition to the sold state and the action to record the<br />
Order that now holds the product.<br />
Inventoried<br />
sell/<br />
setOrder(Order)<br />
Sold<br />
Figure 21-7<br />
Sell the product and record the order.