Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

J2EE Shopping Cart System  RSS feed

 
Rudolf Schmidt
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am developing a shopping cart system for educational purposes and in need of some help. The Application should be web-enabled, distributed and object-based. The system must comply with some requirements. The tiers should be tied together very loosely, which means, that it should be possible to change the data- or presentation layer without to much effort. The presentation layer should not be implemented with JSPs in favor of XML-technologies. I am in the phase of design, so some use cases from analysis exist. Suggestions concerning the architecure are very appreciated.
As far as I know a MVC Pattern could be best choice. Thinking of a controller servlet as application entry point, where should I maintain the shopping cart. Should I use HttpSessions or statefuls Session Beans, or both?
Should I use a XML Framework for presentation, e.g. coocon2?
What job can XML do for me as interface between the tiers?
Can I use containermanaged persistence even if I have SQL statements that result in sums an aggregations?
Thanks in advance for some hints
Rudolf
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Should I use HttpSessions or statefuls Session Beans, or both?
You'll almost certainly need HttpSessions, just to keep the context. A List or Vector of JavaBeans (NOT EJBs!) is usually adequate for a shopping cart - each bean would typically contain a product code (SKU) and quantity or something like that. Save the EJBs for the catalog lookup.
> Should I use a XML Framework for presentation, e.g. coocon2?
I think XML for presentation is a bit overhyped, myself. I prefer to save it for data transport. It's extra overhead when you're just converting the XML to html anyway.
> What job can XML do for me as interface between the tiers?
In this particular case, no benefit I can see.
> Can I use containermanaged persistence even if I have SQL statements that result in sums an aggregations?
Not easily, since the sum is a one-way item and unless you have read-only EJBs (which aren't really explicitly supported in EJB 1.x), you'll have a great deal of difficulty explaining to the container how to persist the result field.
 
Anthony Kwok
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the blueprint pet shop can give some information.
 
faisal mahmood
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can reuse some of the code from the Blueprint's petstore demo program. I am quite sure that source code is available freely from www.javasoft.com/j2ee/ site.
Faisal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!