The Oracle Commerce Platform includes a class that lets you use an alias for Nucleus components. This class, atg.nucleus.GenericReference
, lets you use a name of a Nucleus component to reference another component instance in Nucleus. This is useful if you want systems to have separate names, but be backed by the same service instance. If necessary, someone can later change the configuration of the referencing service to have its own instance. All other systems that utilize the original Nucleus name do not need to be reconfigured. Note that the aliased component must have global scope.
To use the GenericReference
class:
Create an instance of
atg.nucleus.GenericReference
.Give the
GenericReference
the alias name you want to use.Set the
GenericReference's
componentPath
property to the Nucleus address of the globally scoped component you want to reference.
For example, an application might use a customized pricing model for each customer. The pricing model is not actually a separate component, but is contained within the profile repository. You can refer to the pricing model as if it were a separate component with a Nucleus address like /atg/commerce/pricing/PricingModels
. The Nucleus component at /atg/commerce/pricing/PricingModels
is a GenericReference
whose componentPath
property points to the profile repository as follows:
componentPath=/atg/userprofiling/ProfileAdapterRepository
If you later decide to move pricing models out of the user repository and set them up as a separate component, you only need to change the configuration of /atg/commerce/pricing/PricingModels
to use the class of the new separate component instead of atg.nucleus.GenericReference
.