diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/shop/logic/Cart.java | |
| download | Studium-master.tar.gz Studium-master.tar.bz2 | |
Diffstat (limited to 'Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/shop/logic/Cart.java')
| -rw-r--r-- | Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/shop/logic/Cart.java | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/shop/logic/Cart.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/shop/logic/Cart.java new file mode 100644 index 0000000..b636de2 --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Gerald Examples/src/examples/shop/logic/Cart.java @@ -0,0 +1,81 @@ +package examples.shop.logic;
+
+import java.util.List;
+
+import examples.shop.impl.entity.LineItem;
+
+/**
+ * The Cart interface.
+ */
+public interface Cart {
+
+ /**
+ * Adds an item to the shopping cart
+ */
+ public void add(LineItem lineItem);
+
+ /**
+ * Changes the quantities of contents in the shopping cart
+ */
+ public void modify(String productID, int quantity)
+ throws Exception;
+
+ /**
+ * Returns all the shopping cart line items
+ *
+ * @return A collection of Cart LineItems
+ */
+ public List<LineItem> getAll();
+
+ /**
+ * Empties the shopping cart
+ */
+ public void clear();
+
+ /**
+ * Get/set methods for the shopping cart owner's name
+ */
+ public String getOwner();
+
+ public void setOwner(String owner);
+
+ /**
+ * Purchases this cart. The cart will create an order in the database.
+ *
+ * @return The Order confirmation number
+ */
+ public String purchase();
+
+ /**
+ * Returns the subtotal price which has been previously set by
+ * setSubtotal().
+ *
+ * @return the subtotal of this cart items.
+ */
+ public double getSubtotal();
+
+ /**
+ * Sets the subtotal price. Our external pricer bean is responsible for
+ * calculating the subtotal. It calculates it based upon customer discounts
+ * (and can be extended to include other rules as well).
+ */
+ public void setSubtotal(double subTotal);
+
+ /**
+ * Returns the taxes for this Quote.
+ */
+ public double getTaxes();
+
+ /**
+ * Sets the taxes for this Quote.
+ */
+ public void setTaxes(double taxes);
+
+ /**
+ * Returns the total price. Total Price is computed from: 1) Subtotal price
+ * 2) Tax
+ */
+ public double getTotalPrice();
+
+
+}
|
