Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 8. An Illustration of a Componen... > Provision the Solution - Pg. 137

An Illustration of a Component-Based Method 137 Second, additional invariants must be defined as they apply to the interface. These invariants help to simplify the description of the operation behaviors by factoring out common state definitions for the interface as a whole. Particular attention is often paid to cross-interface associations, which can be defined through the use of invariants. Third, the interface type model is completed so that it is compatible with the operation parameters, invariants, and pre-condition/post-condition pairs defined. In a sense, the interface type model forms the vocabulary to be used in their definition. References to objects not a current part of the interface type model are added. As illustrated in Figure 8.9, the accountNew() operation has parameters name and add, and returns a new account number, acc#. There are three pre/post-conditions defined. One, when the credit check succeeds (creditOK) indicates that a new account number is generated. The other two, badCredit and duplicateCustomer, indicate that a default account number is returned when the credit check fails, or the customer name and address already exists in the system. This completes the interface definitions. However, due to the important role these interfaces play in the assembly of applications, it is typical that a great deal of feedback will come from those respon- sible for implementing the systems offering this behavior, and those responsible for using, or con- suming, this behavior. With this feedback the interface definitions are refined to meet the require- ments received from these implementation teams.