Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Business Delegate Design Pattern

 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I had a question in a mock which reads :
Business Delegate facilitates JSP to communicate with EJBs. is it true or false.

Answer is True.

i am confused.

please explain how it is possible.


Thnks and Regards,
 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why are you confused ?
 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am confused on how JSP can communicate with EJB through Business Delegate
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
used to reduce coupling between Web and EJB tiers.

All the request from Web tier to EJB tier goes through Buisness Delegate, So that, if something changes in EJB Tier will not affect Web Tier and vice versa.

Normally, For an application J2EE design pattern flow will be something like,

---> Service Locator
|
Client --> Front Controller --> Business Delegate --|
|
|
----> Session Facade


In the above figure, If you see all the interaction between VIEW(JSP) to Business Tier(EJB tier) goes through Business Delegate.

hth,
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, figure got messed up.

used to reduce coupling between Web and EJB tiers.

All the request from Web tier to EJB tier goes through Buisness Delegate, So that, if something changes in EJB Tier will not affect Web Tier and vice versa.

Normally, For an application J2EE design pattern flow will be something like,




In the above figure, If you see all the interaction between VIEW(JSP) to Business Tier(EJB tier) goes through Business Delegate.

hth,
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again

 
navat venu
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes,J2EE clients(JSPs) interact with service components, such as Enterprise JavaBeans (EJB) which provide business services ,through Business Delegate .Business Delegate uses service locator to locate these business services .
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Other than perhaps for retrieving a collection for populating a select dropdown box, a JSP should not be making any calls to the back end. Calls to the back end are typically business-related and belong in the controller classes.
 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thnx Marc for your reply
 
navat venu
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Other than perhaps for retrieving a collection for populating a select dropdown box, a JSP should not be making any calls to the back end. Calls to the back end are typically business-related and belong in the controller classes


Hi Marc,
Normally we do retrieve a collection for populating a select dropdown box in the "load-on-startup" servlet itself and do data caching in memory(Application variables),so that call to backend is done only once at the application startup and further, jsps which have dropdown box will retrieve the collection from memory rather than making calls to backend every time.

correct me if i am wrong!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic