Business delegate pattern: Difference between revisions

Content deleted Content added
Created page with ''''Business delegate''' is a Java EE design pattern. <ref name=":o_cjp">{{Cite web|url = http://www.oracle.com/technetwork/...'
 
m clean up, typo(s) fixed: Follwing → Following, presentatoin → presentation, increses → increases, accessability → accessibility using AWB
Line 1:
'''Business delegate''' is a [[Java Platform, Enterprise Edition|Java EE]] design pattern.
<ref name=":o_cjp">{{Cite web|url = http://www.oracle.com/technetwork/java/businessdelegate-137562.html|title = Core J2EE Patterns - Business Delegate|date = |accessdate = 22 June 2016|website = Oracle|publisher = Oracle|last = |first = }}</ref> This pattern is directing to reduce the [[Coupling (computer programming)|coupling]] in between business serives and the connected presentation-tier, and to hide the implementation details of services (including lookup and accessabilityaccessibility of [[Enterprise JavaBeans|EJB]] architecture.<ref name=":o_cjp"/><ref name=":stdd">{{Cite book|title = Screening Technical Design Document - Version 2.0|last = |first = |publisher = Indiana state|year = |___location = Indiana, USA|volume = |pages = 7}}</ref> Business delegates acts as an adaptor to invoke business objects from the presentation tier.<ref name=":pjeesp">{{Cite book|title = Pro Java EE Spring Patterns|last = Kayal|first = D.|publisher = Apress|year = 2008|___location = New York|volume = |pages = 161-166161–166}}</ref>
 
==Structure==
Requests to access underlying business services are sent from clients, and lookup services are used by business delegates to locate the business service components.<ref name=":o_cjp"/>
 
===Components===
Basic components are Business delegate, Lookup service and business service.
 
====Business delegate====
Control and protection are provided through business delegate which can have two types of constructures, without ID and with ID, where
ID is a string version of the reference to a remote object such as EJBHome or EJBObject.<ref name=":o_cjp"/>
 
====Lookup Service====
Business service is located by lookup service which is used by the business delegate. the implementation details of business service lookup is encapsulated by lookup service.<ref name=":o_cjp"/>
 
====Business Service====
This a business-tier component, such as an enterprise bean or a JMS component, which provides the required service to the client. <ref name=":o_cjp"/>
 
==Consequences==
Line 18 ⟶ 22:
 
* More flexibility and maintanability as intermediate business delegate layer decouples the business layer from the presentation layer.
* Business delegate exposes a uniform API to the presentatoinpresentation tier to access business logic.<ref name=":pjeespo_cjp"/><ref name=":o_cjppjeesp"/>
 
==Concerns==
FollwingFollowing concers can be considered:
* Maintenance due the extra layer that incresesincreases the number of classes in the application.
* Business delegate should take care of the changes of the remote business object interfaces, and these types of changes are rare.<ref name=":pjeesp"/>
 
Line 30 ⟶ 34:
Resource Delegate:
<Source lang="java">
 
 
public class ResourceDelegate {
Line 141 ⟶ 144:
Remote interface for ResouceSession:
<source lang="java">
 
 
public class ResourceDelegate {
Line 259 ⟶ 261:
 
{{Design Patterns Patterns}}
 
[[Category:Software design patterns]]