Records-sale-ofDescribed-by1ProductProductSpecificatiorCatalogContainsdescription11..*priceitemID0..1Used-byDescribe**SalesStoreLineltemItemStocksquantityaddress1*11..name1.*7Logs-HousesContained-ncompleted1..1*SaleRegisterManagerStarted-bydate1Captured-ontime11Records-sales-onInitiated-byPaid-by1TPaymentCustomerCashieramount
领域模型
如何实现makeNewSale契约(后置条件)创建了Sale的实例ss被关联到Registers的属性被初始化选择控制器类型1还是类型2?
如何实现makeNewSale ⚫ 契约(后置条件) ⚫ 创建了Sale的实例s ⚫ s被关联到Register ⚫ s的属性被初始化 ⚫ 选择控制器 ⚫ 类型1还是类型2?
如何实现makeNewSalebyCreatorandControllerRegister creates abyCreator,SaleSaleby Creatorcreatesanempty:RegisterOcollection(suchasaList) which willeventuallyholdSalesLinelteminstancesmakeNewSalecreate:Salelineltems :createList<SalesLineltem>thisexecutionspecificationisimpliedtobewithintheconstructoroftheSaleinstance
如何实现makeNewSale :Register makeNewSale :Sale create Register creates a Sale by Creator create lineItems : List<SalesLineItem> by Creator, Sale creates an empty collection (such as a List) which will eventually hold SalesLineItem instances by Creator and Controller this execution specification is implied to be within the constructor of the Sale instance
如何实现enterltemsystemasblackboxthenamecouldbe"NextGenPOS"but"System"keepsitsimplethe"."and underline imply an instance, and are explained in alaterchapteronsequencediagramnotationintheUMLexternal actortoProcess Sale Scenariosystem:System:CashiermakeNewSaleaUMLloop[moreitems]loopinteractionenterltem(itemlD,quantity)frame,withabooleanguarddescription,totalexpressionamessagewithendSaleparametersreturn value(s)associatedwiththeitisanabstractiontotal withtaxespreviousmessagerepresentingthesystemeventofanabstractionthatenteringthemakePayment(amount)ignorespresentationpayment data byandmediumsomemechanismthe return line ischangedue.receiptoptional if nothing isreturned
如何实现enterItem enterItem(itemID, quantity) : Cashier :System endSale makePayment(amount) a UML loop interaction frame, with a boolean guard expression external actor to system Process Sale Scenario system as black box the name could be "NextGenPOS" but "System" keeps it simple the ":" and underline imply an instance, and are explained in a later chapter on sequence diagram notation in the UML a message with parameters it is an abstraction representing the system event of entering the payment data by some mechanism description, total return value(s) associated with the previous message an abstraction that ignores presentation and medium the return line is optional if nothing is returned total with taxes change due, receipt makeNewSale loop [ more items ]