Easy shopping cart program in java

Shopping cart is software/application used by product owners, sellers to help there costumer purchases and pay online.
This software is providing products online where buyers can choose the product and add to cart (a virtual basket) and make online payment. The software captures client payment information (usually credit card number) and process the transaction using available secure payment gateway.
My goal here is to create a very basic shopping cart program using core java to get a better understanding of how shopping cart works.
So let’s start by writing an IOrder interface. This interface is having method exposed to client.
Here is over customized exception class ProductNotFoundException, used to throw when any product is not found in cart while retrieving from Cart.
In a shopping cart, Product is a base entity, so we need a class representing Product.
Now lets create a class which implements IOrder interface and do all the core work for us.
Now time to test what we wrote. Create a class which Create get the order from customer, add product, get cart price etc.
Download Sourcecode
Previous
Next Post »