I am developing an online catalogue website with a database containing items for sale. I thought of writing a CatalogueBrowser facade bean that interacts with the entity beans which in turn would pull out data from the database. The JSP page would then call the appropriate method from the CatalogueBrowser facade to start a chain of method-calling that would propagate through the entity beans and end up with an array of ItemDetail objects to display in the JSP page. I am confused on whether I should set the CatalogueBrowser bean (i.e. the facade) as stateful or stateless. I *think* it should be stateless, since it only returns the array of ItemDetail objects and doesn't store anything inside it, but I would like either a conformation of this...or else a good telling-off because I am doing everything upside down and how things should be. Thanks!
How many items do you expect in your catalog? Chances are you don't want to access them through entity beans because you will be loading entity beans and storing them in and out of the container. Your performance will suffer. You probably want to search the db directly for catalog items. A catalog might even be better implemented with an LDAP server. It sounds like a stateless bean. HTH [ January 20, 2004: Message edited by: Rufus BugleWeed ]