SalesPoint Framework v3.0

Hook: Add A Value To A Stock's Contents


Requirement

A certain value needs to be added to a Stock's total value.

For example, consider a post office application where customers can, among other things, buy stamps. A common case would be that customers come to the desk and ask for " stamps for $10 " . As stamps come only in fixed denominations, like $0.20, $0.10, etc., the clerk has to assemble stamps of different denominations so as to fulfil the customer's demand.

Method of Adaptation
Enable Feature
Level of Support
Parameter Pattern  
HotSpot
Data management
Participants
Algorithm , DefaultCountingStockFromValueCreator, StockFromStockCreator, StockFromStockCreatorBT, StockFromValueCreator, Stock, stock , Value, value , DataBasket, dataBasket , algorithm

Changes

  1. choose algorithm to be used for assembling denominations.
  2. if one of the algorithms available in the Framework:
    1. select Algorithm from (DefaultCountingStockFromValueCreator, StockFromStockCreator, StockFromStockCreatorBT).
  3. else:
    1. implementation Algorithm of StockFromValueCreator.
    2. Algorithm.fillStock implements StockFromValueCreator.fillStock .
  4. instance stock of Stock.
  5. instance value of Value.
  6. instance dataBasket of DataBasket.
  7. instance algorithm of Algorithm.
  8. call stock.fillStockWithValue with parameters value, dataBasket and algorithm.

SalesPoint Framework v3.0