13.10. Changes to the Domain Model

There is one datum suggested by these contracts that is not yet represented in the domain model: completion of item entry to the sale. The endSale specification modifies it, and it is probably a good idea later during design work for the makePayment operation to test it, to disallow payments until a sale is complete.

One way to represent this information is with an isComplete attribute in the Sale, of boolean data type:

There are alternatives, especially considered during design work. One technique is called the State pattern, which is explored in Chapter 34. Another is the use of “session” objects that track the state of a session and disallow out-of-order operations; this too will be explored later.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.173.199