Best practices for developing and packaging custom implementation classes

To help guide the development and packaging of your custom implementation classes, consider the following best practices:

IBM Sterling® Order Management System is deployed on the WebSphere Liberty application server as a collection of multiple applications that are packaged into a single EAR file. In the EAR file, the backend JAR files (JAR files from the runtime/jar directory) are present in the <EAR_root>/lib directory. However, the application-specific UI or UI backend JAR files (Jar files from the runtime/repository/eardata/<application_code>/extn/WEB-INF/lib directory) are present in the <EAR_root>/<application_WAR>/WEB-INF/lib directory.

When you are implementing custom classes, first determine whether the custom classes are applicable for application-specific logic (UI or UI backend) or for global backend logic, which applies to all the applications.
  • If a custom class is applicable for global backend logic, which applies to all the applications, follow these guidelines:
    • The custom class must part of a JAR file, which must be packaged in the extensions JAR file. In the extensions JAR file, the JAR file that contains the custom class must be present in the extensions/jars directory.

      As part of the "Build Customized Runtime" UCD process, the backend JAR files are first copied to the runtime/jar directory and then during EAR creation copied to the <EAR_root>/lib directory.

    • The custom class can contain references to classes from other JAR files that are present in the <EAR_root>/lib directory. But a custom class must not contain references to classes from any application-specific JAR files that are present in the <EAR_root>/<application_WAR>/WEB-INF/lib directory.
  • If a custom class is applicable for application-specific logic (UI or UI backend), follow these guidelines:
    • The custom class must part of a JAR file, which must be packaged in the extensions JAR file. In the extensions JAR file, the JAR file that contains the custom class must be present in the extensions/files/repository/eardata/<application_code>/extn/WEB-INF/lib directory.

      As part of the "Build Customized Runtime" UCD process, the backend JAR files are first copied to the runtime/repository/eardata/<application_code>/extn/WEB-INF/lib directory and then during EAR creation copied to the <EAR_root>/<application_WAR>/WEB-INF/lib directory.

    • The custom class can contain references to classes from other JAR files that are present in the <EAR_root>/lib directory and to the classes from the JAR files that are present in its own directory, <EAR_root>/<application_WAR>/WEB-INF/lib. But a custom class must not contain references to classes from application-specific JAR files of a different application WAR file.