Business processes involve complex manipulation of business processes. Business classes participate in several business processes. If the responsibility of orchestrating (making the calls on business objects [may be session and entity beans] necessary to achieve a business process) the business process is placed with the clients of business objects, then clients become difficult to write and business objects themselves become tightly coupled.
Facade in french means face. Hence the facade component exposes a single face for a business process.

Example: Approval of large purchase orders may be a complex business process involving several business objects. In this case a OPCAdminFacade (Order Processing Center) facade ay be introduced that exposes APIs to achieve order processing. In this case the UI code will interface with only the OPCAdminFacade and not with each of the business objects.
Giving access to each small interface on the lower level business components increases network traffic and latency.
public interface OPCAdminFacade extends EJBObject {
public OrdersTO getOrdersByStatus(String status)
throws RemoteException, OPCAdminFacadeException;
public Map getChartInfo(String request,
Date start,
Date end,
String requestedCategory)
throws RemoteException, OPCAdminFacadeException;
}
OPCAdminFacade would be implemented in OPCAdminFacadeEJB.
The getOrdersByStatus would interface with ProcessManagerLocal and ManagerLocal to get a list of PurchaseOrderLocal entity beans. It then creates a List of transfer objects (OrderDetailsTO [transfer object]) and returns them to the client.
No comments:
Post a Comment