• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Questions on PetStore architecture

 
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Resurrecting the thread.. Any takers please ....
Thanks

Dhiren
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you could have a look at MVC archtecture.
For example struts.


Web tie always use MVC.
reply
    Bookmark Topic Watch Topic
  • New Topic