BookStore
raises
module ECommerceModule { exception CreditDenialException { string reason; }; struct CreditInfo { string cardnumber; string expdate; float creditLimit; }; };
module BookShopModule { struct Book { string title; string author; }; typedef sequence<book> BookList; struct Sale { Book bk; float discount; }; typedef sequence<sale> SaleList; struct PriceInfo { Book bk; float discount; float price; }; typedef sequence<priceinfo> PriceInfoList; enum OrderStatus { BackOrdered ,Available ,Unavailable ,Unknown, Satisfied }; struct BookOrder { Book bk; long numCopies; float price; OrderStatus status; }; typedef sequence<bookorder> BookOrderList; exception BookDoesNotExistException { Book bookDesc; }; exception InventoryException { Book bookDesc; string reason; }; exception InvalidSaleException { string reason; };
interface BookStoreInv { long getNumCopiesOfBook(in Book bk) raises (BookDoesNotExistException); boolean isBookInStock(in Book bk); Book getBook(in string title) raises (BookDoesNotExistException) ; BookList listAllBooks(); void addBook(in Book bk,in float cost) raises (InventoryException); void addCopies(in Book morecopies,in long qty) raises (InventoryException, BookDoesNotExistException); void removeCopies(in Book bk,in long qty) raises (InventoryException, BookDoesNotExistException); OrderStatus getOrderStatus(in BookOrder order) raises (BookDoesNotExistException); void satisfyOrders(inout BookOrderList books) raises (BookDoesNotExistException,InventoryException); }; interface Pricer { attribute float standardMarkUp; float priceBook(in Book bk) raises (BookDoesNotExistException) ; void priceOrders(inout BookOrderList order) raises (BookDoesNotExistException ); void addSale(in Sale sale) raises (BookDoesNotExistException, InvalidSaleException); void removeSale(in Sale sale) raises (BookDoesNotExistException, InvalidSaleException); boolean isBookOnSale(in Book bk,out float salePercentage) raises (BookDoesNotExistException) ; SaleList listAllSales(); }; exception ServiceException { string reason; string detail; };
interface BookStore { readonly attribute string storeName; OrderStatus getBookStatus(in string title) raises (ServiceException) ; BookList listAllBooks(); BookList listBooksForAuthor(in string author); PriceInfoList lookUpBookPrice(in BookList list) raises (ServiceException) ; BookOrderList buyBooks(in BookList list,in ECommerceModule::CreditInfo info ) raises (ServiceException,ECommerceModule::CreditDenialException); }; };
BookDoesNotExistException
BookStoreInv
Pricer
CreditDenialException
InventoryException
InvalidSaleException
bookstoreserver.BookStoreImpl
lookUpBookPrice()
buyBooks()
CreditInfo
EcommerceModule
import
BookShopModule.BookStoreInv
BookShopModule.Pricer