aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Confused about Pet Store controllers and J2EE patterns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Confused about Pet Store controllers and J2EE patterns" Watch "Confused about Pet Store controllers and J2EE patterns" New topic
Author

Confused about Pet Store controllers and J2EE patterns

Tomi Tuomainen
Ranch Hand

Joined: Jun 13, 2004
Posts: 86
After some studying Pet Store WAF, J2EE patterns and Cade's component diagrams some questions came up...

How does Pet Store Web Controller relate with patterns Business Delegate and Service Locator? Can we think of Web controller as a component including Business Delegate and Service Locator?

Can we think of EJB Controller as a session facade? Cade is using stateless session bean, WAF EJB Controller is a stateful one (why?).

In general.. do you think we should model WAF controllers as components or J2EE patterns as components (as Cade is modeling Service Locator)?

Thanks,
Tomi
Ramon Gill
Ranch Hand

Joined: May 15, 2003
Posts: 344
Tomi,
P375, Fourth paragraph, of Blueprints says that a local architecture (which PetStore is) does not need BusinessDelegates and ServiceLocators. The WebController passes an Event to the EJBController. The EJBController has a command pattern which passes the event to the correct Session Facade (note. Doesn't have to be a Session Facade. Could be a POJO).

The EJBController is stateful because it is storing conversational state on behalf of a client (i.e. shopping cart).

Choosing between WAF Controllers or J2EE patterns as components is a tough one. Hopefully, someone who's passed can answer better. I suppose you can do either as long as the comments explain things. Do you model based on Cade or Petstore?

Ray
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Confused about Pet Store controllers and J2EE patterns