aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Business Delegate Design Pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Business Delegate Design Pattern" Watch "Business Delegate Design Pattern" New topic
Author

Business Delegate Design Pattern

KRK Gowda
Ranch Hand

Joined: Nov 02, 2004
Posts: 132
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

Joined: Jun 28, 2003
Posts: 547

why are you confused ?


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
KRK Gowda
Ranch Hand

Joined: Nov 02, 2004
Posts: 132
I am confused on how JSP can communicate with EJB through Business Delegate
Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502

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<br />SCJP 1.4,SCWCD 1.4<br />prabhu.venkatachalam@gmail.com
Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502

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

Joined: Nov 16, 2005
Posts: 502

Again

navat venu
Ranch Hand

Joined: May 14, 2006
Posts: 66
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 .


-------------------- <br />SCJP 1.4<br />SCWCD 1.4<br />SCBCD 5(in progress)<br /> <br />"Do, what you think that you cannot do"
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727



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.


A good workman is known by his tools.
KRK Gowda
Ranch Hand

Joined: Nov 02, 2004
Posts: 132
Thnx Marc for your reply
navat venu
Ranch Hand

Joined: May 14, 2006
Posts: 66
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!!
 
 
subject: Business Delegate Design Pattern