The Spring Framework is a lightweight, open source programming and
configuration model for developing Java based enterprise applications. This framework is used in
HCL Commerce for building and configuring Management Center, including the managing
of URL requests from Management Center to retrieve and process object data.With
Management Center built with the Spring framework, which includes built-in best practices and
design patterns, your site developers can customize Management Center more easily. Developers
can focus more on application-level programming to meet business needs when customizing Management Center and less on the underlying infrastructure of Management Center.
The Spring framework is a modular framework for building enterprise applications and includes
many different modules. Within
HCL Commerce, the following Spring framework layers and
modules are used to build
Management Center:
- The Core Container layer, specifically the spring-core,
spring-beans, spring-context, and
spring-expression modules. The spring-core and
spring-beans modules are the fundamental parts of the Spring framework. All
other Spring framework modules are built upon these core modules. These modules provide the
Inversion of Control (IoC), dependency injection, and Spring bean features of the framework, which
are used in HCL Commerce. The Spring framework uses the
spring-context module to access objects and adds support for internalization.
This module also supports the use of Java EE features, such as EJB, within the framework. The
spring-expression module provides the expression language that the framework
uses to query and process a bean object.
- The Spring web layer, specifically the spring-web, and
spring-webmvc modules. The spring-web module provides the
basic web-specific integration features that are required by Management Center. The framework
uses this module to initialize the Spring IoC container. The spring-webmvc
module, which is also known as the Spring Web-Servlet module, provides the
Spring Model-View-Controller (MVC) framework that HCL Commerce uses with Management Center. The spring framework MVC can be used with a servlet or portlet environment. The MVC
framework that is used in HCL Commerce is non-portlet. The MVC framework that is used in
HCL Commerce uses the Spring dispatcher servlet
A Spring bean is an element is defined in a Spring framework configuration file. These bean
definitions define the
Management Center objects that are managed by the Spring framework IoC
container. The framework can instantiate or destroy these bean objects as needed, and uses the beans
to create class instances. The bean definitions, which are also called controller configurations
within
HCL Commerce, include the properties and dependencies that the Spring framework
uses to create, update, and delete the bean objects. The attributes, properties, and dependencies in
each configuration must define the following information for the Spring bean object:
- The associated controller (application) class to use to retrieve or process the bean object or
service URL request from Management Center. Each bean must map to a class with the
package-qualified class name.
- The unique identifier for the controller configuration bean element. This identifier is used by
the framework to identify the configuration. The identifier also maps the bean object to an object
definition or search definition for the Management Center object or service.
- The properties that are to be used to define how the associated controller class is to process
the URL request and use the bean object.
- The dependencies that reference other beans or resource bundles that are needed for the class to
handle the bean object and URL request.
- Any other configuration settings or parameters to include within the bean object.
HCL Commerce currently uses the Spring framework 5.3.33 release. For
more information about this version of the Spring framework, including the framework
layers and modules that are used in HCL Commerce, and Spring beans, see
Spring framework 5.3.33 release.
For more information about the Spring framework in general, see Spring framework.
Spring MVC framework
The Spring MVC framework is request-driven framework that uses a central dispatcher servlet to
handle the URL requests from Management Center. This Spring DispatcherServlet
dispatches requests to the controller classes that are identified within bean definition controller
configurations for retrieving and processing data.
The Spring MVC framework is composed of the following parts:
- Model, which represents the business or database code; the actual Management Center object
data. The Model object is a map interface, which the framework transforms into the XML formatted
View that is expected by Management Center. The framework uses the appropriate serialization
JSP fragments identified by the Controller to transform the Model to create the View.
- View, which represents code for designing the XML-formatted response of the Model that displays
to Management Center users.
- Controller, which represents the controller class that retrieves or processes the data to
generate the Model. The Controller receives a URL request from Management Center and uses the
corresponding controller configuration to generate the Model and select the JSP file to use to
transform the Model into the View.
For more information about the MVC framework, see Spring MVC framework.
For more information about the Spring dispatcher servlet, see Spring class DispatchServlet.
Customizing the Management Center Spring framework definitions
All major aspects of the
Management Center web application are configured within Spring
framework configuration files.
HCL Commerce uses multiple Spring definition files to
configure
Management Center. A different configuration file is used for mapping the
configurations for each
Management Center component. There is also an extension configuration
file for you to use to define your own custom mappings for custom objects or to override existing
mappings in the configuration files that are provided by
HCL Commerce.
- A spring-ibm-component.xml file is provided for each
Management Center component to define the URL mappings that are required for retrieving and
processing data for the component objects. For example, the
spring-ibm-catalog.xml file defines the mappings for the catalog
component.
- A spring-extension.xml file is provided for you to use to override existing
mappings or to define mappings for custom objects and views. Do not modify any
spring-ibm-component.xml files. Use only the
spring-extension.xml file to change or define mappings.
All Spring configuration files are included within the
LOBTools project in
HCL Commerce Developer environments and in the
LOBTools web module in other
HCL Commerce environments. When you are working within the Enterprise Explorer view in
HCL Commerce Developer, you can find these configuration files in the following directory:
For more information defining your own custom controller configurations in the extension file,
see Customizing controller configurations.