First of all I would like to know whether my view is correct or not. I have products that are stored in an XML file. I am reading this file and storing the products so that I can pass it on the JSP page. Here is my Product.xml file
I should also know what kind of data structure should be used. Since the product page, I have to add a cart button for each product.
& lt; Inventory & gt; & Lt; Products & gt; & Lt; Name & gt; Dictionairy & lt; / Name & gt; & Lt; Details & gt; Words from the English language & lt; / Description & gt; & Lt; Price & gt; 400 & lt; / Pricing & gt; & Lt; / Products & gt; & Lt; Products & gt; & Lt; Name & gt; Calculator & lt; / Name & gt; & Lt; Details & gt; Number of resolutions & lt; / Description & gt; & Lt; Price & gt; 1000 & lt; / Pricing & gt; & Lt; / Products & gt; & Lt; Products & gt; & Lt; Name & gt; LCD & lt; / Name & gt; & Lt; Details & gt; Displaying Output from Computer & lt; / Description & gt; & Lt; Price & gt; 8000 & lt; / Pricing & gt; & Lt; / Products & gt; & Lt; / List & gt; OK, as a quick shot, I have a class inventory < / Code> contains a collection of product category, which represent all potential products. After this there is a class cart which may contain products (references to products) and quantities (this can actually be a CartPosition and cart Note that Inventory should be stored in the application area, because it appears to be identical to each customer. Keep in mind that access to inventory may need to be synchronized or minimized / hidden until it is fully read. Cart on the other hand can be stored in the session. Also keep in mind that this is a very easy way. A real shop involves a lot more.
Comments
Post a Comment