Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Petstore app. controller = the EJB controller + controller proxy?

 
Rudi Vaum
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anybody clear how this works?
"The sample applications controller is in two parts: the EJB controller,
which interacts with enterprise beans and a controller proxy"
[..]
But the second edition only says:
"Each type of client needs its own controller, which specializes in the
protocols
for that client type. A particular type of client may also need different
presentation
components for form factor or other reasons."
Do you know if the code of the Petstore changed in that respect?
Thanx
Rudi
[..]
[ May 28, 2003: Message edited by: Rudi Vaum ]
 
Rudi Vaum
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this prety good explanation of multi-tiered MVC:
http://mindtelligent.com/mvc.html
They describe a structure like this:
Front Controller(servlet) --> Request Processor --> App. Controller(a Web-tier proxy) --> app. Controller(SFSB).
Now, i had before in mind something like:
Client --> Business Delegate --> Session Facade(EJB) --> Business Objects(EJB)
It was clear to me that I missed the controller, but how do I make the best out of these two?

Any ideas?
Rudi
PS: is there any compatibility between business delegate and proxy, in this context?
[ May 28, 2003: Message edited by: Rudi Vaum ]
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For Web clients, I recommend -
Web(View) --> Front Controller(servlet) --> Web Dispatcher --> Business Delegate--> Session Facade(SLSB) --> Entity bean/DAO
For non-web clients, I propose -
Client --> App Controller(SLSB) --> App Dispatcher --> Business Delegate--> Session Facade(SLSB) --> Entity bean/DAO
As you can see, everything beyond Business Delegate remains same. Only the Controller and Dispatcher are implemented differently for web and app clients. Request Processor can be implemented between Front Controller and Dispatcher, but in a simple implementation, you can roll it up into Front Controller.
Any comments?
 
Peter Dawson
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajith,
Why do you model the App Controller as SLSB? This implies that the App Controller is remote from the app client, but the app client could be 'fat' and model the app controller as a javabean.
best
Peter
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
App Controller is an EJB so that non-web clients can direclty access it through RIM/IIOP ...
 
Rudi Vaum
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[...]
2nd question: Any stategy to reuse some part of the controller? If the clients expose the same functionality, this clearly should be the case.
3rd question: i'll make a new post of this...
please comment
[ May 30, 2003: Message edited by: Rudi Vaum ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic