Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

WAF Question

 
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
This is the link with figure 11.9.

http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/app-arch/app-arch5.html#1100693

Ray
 
What do you have in that there bucket? It wouldn't be a tiny ad by any chance ...
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic