Develop > Business logic layer > Developing the business logic layer using the BOD command framework
Work with WebSphere Commerce service modules
WebSphere Commerce service modules contain the definitions for the nouns, generated code, and other information about the services that are supported. That is, a service module is a collection of related business objects for some business purpose.
- Create a WebSphere Commerce service module
The WebSphere Commerce service module contains all the assets used by a WebSphere Commerce service. If you are planning on providing new WebSphere Commerce services, you create a new service module, then further customize and extend the assets it creates. The Java Emitter Template (JET) used to generate the base code for the new service module from a simple XML file. By describing the service module in a specialized XML syntax, the service modules can be generated. This allows you to start directly with the service module implementation without having to spends hours with the setup and configuration of a service module.
- Implement the service commands in the BOD command framework
Creating the service commands for a BOD service module consists of running the Design Pattern Toolkit and then customizing and extending the template code that is generated.
- Implement access control in the BOD command framework
In the BOD programming model, the resources that services act upon are nouns, which are represented by generated logical SDOs. However, these SDOs do not implement the Protectable interface, which is required in order for the PolicyManager to verify that a service has the rights to work with these nouns. A wrapper class must be implemented for each noun to extract the information required by the PolicyManager to perform its checks. This mapping is defined in the wc-component.xml file.
- Add a custom user or error message to a BOD service module
Adding custom messages to the BOD framework commands involves creating the properties file with a specified naming convention and location. The logging framework is configured to traverse up the package hierarchy and find and load any resource bundles (properties files) with names matching the naming convention.
- Configure a BOD service module
Configuration files get loaded when their component is first called. The class loader automatically discovers the configuration directories, by following the naming conventions. When resolving configurations, custom configuration always takes precedence over the base configuration. At runtime, command developers can retrieve the configuration information by using the ComponentConfigurationRegistry Java class, which retrieves the class responsible for parsing and providing an interface to retrieve the information. There are two ways add configuration data to a service module. The first way is to extend the default WebSphere Commerce configuration XSD. This allows you to quickly add name-value pairs to the configuration data of an existing component. The second way is to define the own configuration file structure, and provide the own configuration file parser. This approach, while more complex, is quite flexible – everything from the structure of the configuration file itself to the implementation of the parser, can be changed.
- Reload the configuration of a BOD service module
During development, you may want to modify and reload configuration, without having to restart the server. This is supported through the use of a .reloadconfig file.
- Deploy the client library
The client library for a WebSphere Commerce service can be deployed in one of four possible environments:
Related concepts
WebSphere Commerce BOD command framework
Business logic layer design patterns
Access control in the BOD command framework