Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Petstore Application

 
Eric Lefurge
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Folks
I was reviewing the petstroe application and found a few interesting things.
To my suprise, the controller is a Session bean instead of a servlet as in the case like STRUTS framework. Any thoughts on this approach ???
Also I am confused regarding which EJB is handling the scenario of updating the inventory, sending email, verifying creditcard etc. when the customer confirms the order.
Thanks for ur time

Eric
 
Eric Lefurge
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Folks
I answer to myself
I found out that the controller in the petstore example works in 2 tiers the main servlet at the webtier and the Shoppingclient controller at the EJB tier.
And regarding who does the final processing once the order is committed, its the StateMachine which interacts with inventory, order and mailer.
Is StateMachine similar to a DAO ?? and the ShoppingClientController similar to a SessionFacade ???
Eric
 
bill lubx
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From my point of view, stateMachine is a processor in Business Logic tier (EJB tier), which uses Command factory to get the proper Command Handler (EJB Action classes) to deal with the Events. While DAO is more focused on data access with less complicated business logic. ShoppingClientController is a subclass or adapter of EJBClientController, which represent the component controller for shopping card and custom related issue. This controller is used for read_only direct access from web tier help class and update access from EJB tier Command Handler.
Correct me if I am wrong.
Thanks
/bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic