Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package servants;
- import dbConnection.DbConnector;
- import shoppingCart.Cart;
- import shoppingCart.Product;
- import shoppingCart._ShopImplBase;
- public class ShopServant extends _ShopImplBase {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- DbConnector dbConnection = new DbConnector();
- CartManagerServant cartManagerServant = null;
- @Override
- public Product[] showAvailableProducts() {
- Product[] pTable = null;
- dbConnection.connectToDb();
- pTable = dbConnection.getAllProducts();
- dbConnection.closeConnection();
- return pTable;
- }
- @Override
- public Cart createNewCart() {
- if(cartManagerServant == null) {
- cartManagerServant = new CartManagerServant();
- }
- return cartManagerServant.createNewCart();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement