The business layer classes contain the logic for managing gift lists and items. The methods within these classes are used to create, update, and delete selected gift lists for a given customer. The business layer components are the interface to the Giftlists
repository. All calls to modify a gift list are made through these classes.
Business layer objects include the following three classes: GiftlistManager
and GiftlistTools
.
GiftlistManager
: The majority of the functionality for gift list management exists in theGiftlistManager
component. The class contains such methods ascreateGiftlist
,updateGiftlist
,addItemToGiftlist
andremoveItemFromGiftlist
. These methods are higher level than those inGiftlistTools
. It calls methods in the tools object to perform the lower level functionality (for example, repository access, property update).GiftlistTools:
TheGiftlistTools
component is the low level interface and contains the logic for creating and editing gift lists in the repository.GiftlistTools
is usually not called directly. It is usually called by the manager class to perform functionality on gift lists. This class defines repository item descriptors and property names and uses them to make updates to the repository.
Because these classes do not contain any state, it makes sense for them to exist as globally-scoped services in ATG Commerce. Rather than constructing a new object when required, ATG Commerce places one instance of each into the Nucleus hierarchy to be shared. They can be found in the hierarchy under:
GiftlistTools
-/atg/commerce/gifts/GiftlistTools
GiftlistManager
-/atg/commerce/gifts/GiftlistManager
Note: Gift lists use the ClientLockManager
component to control locks on repository items. The ClientLockManager
prevents a deadlock situation or data corruption that could occur when multiple customers update the same gift list. The ClientLockManager
is located at /atg/dynamo/service/ClientLockManager
. See the Using Locking in Fulfillment section of the Fulfillment Framework chapter for more information on the ClientLockManager
.