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

Questions on PetStore architecture

 
Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to understand and implement the petstore WAF
,I have a few doubts about the architecture

1. What is the basic purpose of the Web Controller and the EJB Controller and when do we need such kind of abstraction?
I understand the Event model of the application and its use but could not understand the need for classes PetstoreComponentManager.java and ShoppingWebController.java which in turn calls the methods of DefaultWebController.java

2. Why is the handleEvent() method of
ShoppingWebController.java 'synchronized' ? Anyway there will be
different threads of MainServlet.java which will handle the requests so
why to use 'synchronized' ?

3. ShoppingWebController's handleEvent() method simply delegates the call
to a stateful session bean ShoppingControllerEJB's handleEvent()
method. Why is ShoppingControllerEJB a stateful session bean ? Is it
just to cache the references to other beans in the
ShoppingClientFacadeLocalEJB.java ?? What if ShoppingControllerEJB were
a stateless session bean? Even then we could have cached the bean
references in a simple java class depending on the userId.

4. What is the role of StateMachine class ? We could have directly called
the EJBAction class's methods from the EJBControllerLocalEJB's
handleEvent() method. What is the use of this layer?

5. We could have had the references to other beans in
ShoppingControllerEJB.java itself . What is the need for
ShoppingClientFacadeLocalEJB.java ?? What is the use of this layer??

6. StateMachine.java is having a reference to EJBControllerLocalEJB and
EJBControllerLocalEJB.java is also having a reference to StateMachine
object. Why is this so and when do we need the bean's reference from
StateMachine object??

Any help on the above set of questions would be appreciated.

Thanks,
Dhiren
 
Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
resurrecting the thread. Please reply some one.
Thanks
Also can some one explain the application service implementation in Pet store .

Thanks
Dhiren
 
Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Resurrecting the thread.. Any takers please ....
Thanks

Dhiren
 
Hu Rui
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you could have a look at MVC archtecture.
For example struts.


Web tie always use MVC.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic