13.07.2015 Views

Object-Oriented Software Development with UML - UNU-IIST ...

Object-Oriented Software Development with UML - UNU-IIST ...

Object-Oriented Software Development with UML - UNU-IIST ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

86 Contracts for System OperationsPre-conditions:Post-conditions:UPC is known to the system.= K+R§Z†N„†O^Aa]?Y’M_Z[NCXNwas set to CTEWHJN (attribute modification).Here, we notice that we have discovered a new attribute for class K+RZ[N which is O^Aa]?Y’M_Z[NCXN , so we shouldadd it to the conceptual model that we created in Chapter 3.Contract forRB¥N9>¨ReŶ NUsC ŶContractName:Responsibilities:Type:makePayment(amount: Quantity).Record the payment, calculate balance and print receipt.System.Cross References: System Functions: R2.1Use Cases: Buy ItemsNote:Exceptions:If sale is not complete, indicate that it was an error.If the amount is less than the sale total, indicate an error.Output:Pre-conditions:Post-conditions:A was created (instance=>¨ReŶ NUsCW„°RŶ ?H…UsC9œ+NDU_GNE;N9Gcreation).was set to (attribute medication).?H…UsC =The was >@ReYdNDU_C associated <strong>with</strong> the (association formed).K+RZ[N RŶ >@R§eBYdNUsC =The was associated <strong>with</strong> the , to add it to the historical log of completed=sales (association K_C`?E:N K+RZ[N formed).Contract for startUpIt is easy to identify a K_C`REDC m Muse case for the POST system, and thus identify a AWC`REDC m M ¤£operation.And in fact, every system should have such an operation. However, although the K_C`R§EWC m Muse case and theAWC`R§EWC m M ¤£operation are always carried out first when the system start to work, they can be finalized onlyafter it is clear about what are needed for carrying out the other use cases and operations. The contract ofAWC`R§EWC m M ¤£for the POST system can be given as follows.ContractName:startUp().Report No. 259, July 2002<strong>UNU</strong>/<strong>IIST</strong>, P.O. Box 3058, Macau

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

Saved successfully!

Ooh no, something went wrong!