• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WAF Question

 
D. Rose
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Following is Petstore components description.

ShoppingCartEJB�(Stateful) maintains the contents of an individual user�s virtual shopping cart
ShoppingControllerEJB�(Stateful) provides access to the Shopping Client Facade; extends the WAF EJB controller (EJBControllerLocalEJB)
ShoppingClientFacadeEJB�(Stateful) caches references and provides unified access to customer, shopping cart, and user ID


So I think there are 2 channels(web controllers) to EJB layer

1. For stateless logic - EJBController -->EJBaction--->SLSB.
2. For stateful logic (which is only shopping cart)
ShoppingControllerEJB--SFSB.


I am not clear if in (2) if there are any actions involved. The shopping cart desription says following


The Web tier maintains a reference to the EJB-tier controller in an HttpSession attribute. The EJB-tier controller�s method getShoppingClientFacade returns a reference to a ShoppingClientFacadeLocal interface. The shopping client facade�s
getShoppingCart method returns the current session�s shopping cart.



Can anybody please explain?
 
Ramon Gill
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have spent many hours studying 'Petstore'. I think they could have explained things a bit better. Anyway, here's my view on what's going on. Hope it helps.

I think there is only 1 web controller to the EJB Layer (you said 2). This is to access shopping cart processes. This is why all the descriptions of the sessions beans you mention above are 'stateful'. If you look at figure 11.9 on page 373 of the 'Blueprints', its the 'right-hand side' path to EJB's.

The catalog jsp pages use helpers (custom tags) to access business delegates that then access the session facade for catalog processes. This is the 'left-hand side' path to EJB's for figure 11.9 on page 373. This is because its a read-only process. Value objects are returned which JSP's access via javabeans.

Ray
 
D. Rose
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ramon,

I was looking at
http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/sample-app/sample-app1.3.1a3.html


Could you please take a look at it and tell me which figure you were talking of?
Thanks.
 
Ramon Gill
Ranch Hand
Posts: 344
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic