1 package ejava.examples.blpurchase.bl;
2
3 import java.util.List;
4
5 import ejava.examples.blpurchase.bo.Product;
6
7 /**
8 * The catalog maintains a view of the inventory known to our application.
9 */
10 public interface Catalog {
11
12 /**
13 * Returns a list of products in the catalog chunked into page sizes.
14 * @param offset
15 * @param limit
16 * @return list of products matching the paging criteria
17 */
18 List<Product> getProducts(int offset, int limit);
19
20 /**
21 * Adds the selected product to the users' shopping cart and returns
22 * the count of items.
23 * @param id
24 * @param validEmail
25 * @return number of items in cart
26 */
27 int addToCart(int id, String validEmail);
28 }