S++Business systems language
DEMO SOURCE · SPP / APP / PHYRead the book

petshop-00-model.spp

petshop/cart/petshop-00-model.spp

Download original file · Petstore source contents

1domain petshop;23Role CartLine {4    Buyer buyer;5    Goods goods;6    int quantity;7}89take Goods, Buyer as CartLine {10    Goods goods = Goods;11    Buyer buyer = Buyer;12}1314Role Cart {15    Buyer buyer;16    CartLine[] lines;17}1819take Buyer as Cart {20    Buyer buyer = Buyer;21}2223Contract CartAdditionAgreement {24    Buyer buyer;25    Cart cart;26    Goods goods;27    int quantity;28    Receipt receipt;29}3031Contract CartQuantityAgreement {32    Buyer buyer;33    Cart cart;34    Goods goods;35    int quantity;36    Receipt receipt;37}3839Contract CartRemovalAgreement {40    Buyer buyer;41    Cart cart;42    Goods goods;43    Receipt receipt;44}4546Contract CartClearingAgreement {47    Buyer;48    Cart;49    Receipt;50}