BookStore
module ECommerceModule { struct CreditInfo { string cardnumber; string expdate; float creditLimit; }; };
module BookShopModule { struct Book { string title; string author; }; typedef sequence<book> BookList; struct SaleInfo { Book bookTitle; float discount; float originalPrice; }; typedef sequence<saleinfo> SaleInfoList; enum OrderStatus { BackOrdered ,Available ,Unavailable ,Unknown }; struct BookOrder { Book bk; long numCopies; float price; OrderStatus status; }; typdef sequence<bookorder> BookOrderList; interface BookStoreInv { int getNumCopiesOfBook(in Book bk); boolean isBookInStock(in Book bk); Book getBook(in string title); BookList listAllBooks(); void addCopies(in Book morecopies,in long qty); void removeCopies(in Book bk,in long qty); OrderStatus getOrderStatus(in BookOrder order); void satisfyOrders(inout BookOrderList books); }; interface Pricer { attribute float standardMarkUp; float priceBook(in Book bk); void priceOrders(inout BookOrderList order); void addSale(in SaleInfo sale); void removeSale(in SaleInfo sale); boolean isBookOnSale(in Book bk,out float salePercentage); SaleInfoList listAllSales(); };
interface BookStore { readonly attribute string storeName; OrderStatus getBookStatus(in string title); BookList listAllBooks(); BookList listBooksForAuthor(in string author); SaleInfoList lookUpBookPrice(in BookList list); BookOrderList buyBooks(in BookList list,in ECommerceModule::CreditInfo info ); }; };
bookstoreserver.BookStoreImpl
String getStoreName()
OrderStatus getBookStatus(String title)
BookList listAllBooks()
BookList listBooksForAuthor(String author)
SaleInfoList lookUpBookPrice(BookList list)
BookOrderList buyBooks(BookList list,CreditInfo info)
BookShopModule.BookStoreInv
BookShopModule.Pricer
CreditInfo
EcommerceModule
import