Component facade interfaces

A component facade is used to group a set of related business objects and provide support for the services associated with those objects. The methods on the component facades represent operations, also known as verbs, on WebSphere Commerce nouns. For example, the member component facade implements the Get verb on the Person noun.

The component facade implementation is a Java interface with a one-to-many mapping of noun to interfaces. A noun is implemented by only one facade interface. The methods on the facade interface match the Business Object Documents (BODs) supported for that noun. The types of verbs performed on the noun are Get, Change, Process, or Sync. The naming convention for the method is the name of the BOD (verb + Noun) with the first letter in lower case; for example, syncPerson() for the SyncPerson BOD. If a noun does not support a particular verb, then the method will not exist on the component facade.

As for the implementation of the component facade, each method should use the command framework to select the appropriate service command to process the request. The service command is the entry point on the component facade where the BOD begins to be processed by the business logic. The service command breaks down the request into a series of business tasks and calls the appropriate commands to complete these tasks.

For more information on BODs, see
WebSphere Commerce use of Open Applications Group (OAGIS) messaging.

 

Runtime environment

The same component facade is used regardless of how the request enters the system. Each presentation layer must have the associated presentation framework and configuration in place to bind the component to that presentation. In the case of Web services, the Web services deployment descriptors and assets are required to enable the component for Web services. In the case of Web enablement for Struts or the WebSphere Commerce foundation tag library, the client library must have the required framework methods to integrate with the presentation layer and delegate the request to the component. All presentation-specific logic is contained at the presentation layer and only common logic that is independent of the presentation layer is part of the component facade.

As for the Java component facade implementation, the component consists of a Java bean that delegates to the business object document (BOD) processor to process the request. The BOD processor is a runtime environment that manages the request. This BOD processor performs the appropriate runtime setup and then delegates to commands to implement the request. The commands are part of the component facade and represent the business logic associated with the OAGIS request. The commands can call other commands and access or update the database depending on the request.

The BOD processor consists of a flow of runtime services that are performed to prepare the request. This flow, as shown in the following diagram, consists of transaction management, and business context setup. These services are independent of the component and should be decoupled from the business logic. After the processor takes control of the request, it enforces some of the quality of service requirements specified by the application.

  1. The Service Data Object (SDO) is given to the BOD processor by the Java facade. For example, the ProcessPerson SDO would be given to the BOD processor by the MemberFacade Java facade.

  2. The BOD processor initiates the transaction and associates the business context information with the request by extracting the business context data from the application area of the BOD.

  3. The BOD processor creates and runs the BOD command used to represent the business logic of that service. For example, the ProcessPerson command would be called by the BOD processor and will be passed the ProcessPerson SDO.

  4. The BOD command, for example ProcessPerson, performs the appropriate business logic for processing the BOD.

  5. The BOD processor retrieves the response document SDO from the BOD command, retrieves the context data from the business context, and adds it to the response document SDO. For example, the response returned by the ProcessPerson command is an AcknowledgePerson SDO.

  6. The BOD processor returns the returned SDO to the calling Java facade.


Related Concepts


6.0.0.1Verbs
Nouns
6.0.0.1WebSphere Commerce use of Open Applications Group (OAGIS) messaging
Get Request and the Show Response
Process request and the acknowledge response
Change Request / Respond Response
Sync request and the ConfirmBOD response
WebSphere Commerce services
WebSphere Commerce service module
Service Data Objects (SDO)
Client library for WebSphere Commerce services

Related tasks

Create the component facade
Deploying the component facade
Testing a WebSphere Commerce service