The ATGMobileClient project is a collection of managers, each having responsibility for a particular area of business logic.

Managers

The ATGRestManager has the important responsibility of establishing a connection to the server. Each of the other managers uses the ATGRestManager to make a request to the server via REST. The ATGRestManager also includes a number of helper methods for frequently-performed tasks. For example, checkForError checks a REST response for errors.

Managers encapsulate request creation and response management logic that ViewControllers can use to handle the creation of requests for data, and the receipt of their responses. ATGManagerRequest is a wrapper around ATGRestOperation and is the base class for all other requests in CRS-IUA. ATGManagerRequest gets a reference to the result of the call. For example, the ATGProfileManager.getProfile method returns a reference to an ATGProfileRequest, which contains the actual profile representation in its requestResults property.

Each manager uses a corresponding subclass of ATGManagerRequest for its server communication. For example, ATGProfileManager uses ATGProfileRequest. The definitions of the managers and their requests are located in the Managers directory of the ATGMobileClient project.

The following table shows the managers that are provided by CRS-IUA and a brief summary of their responsibilities.

Manager

Responsibility

ATGCommerceManager

All commerce-related functions such as cart actions, billing, shipping, and checkout.

ATGGiftListManager

Performs many operations on gift lists and wish lists. A wish list is a gift list that is specific to a user.

For example, creating and modifying gift lists, adding and removing items, copying and moving items between lists, searching for gift lists, etc.

Note: Gift and Wish list functionality in CRS-IUA is more limited than Commerce Reference Store.

ATGKeychainManager

Saving and retrieving values from the iOS keychain.

ATGProductManager

Retrieving product information including inventory levels and registering for back-in-stock notifications. Also retrieves product comparison requests.

ATGProfileManager

User-related functions such as login/logout and account management functions such as viewing and editing a profile.

ATGExternalProfileManager

User-related functions such as login/logout and account management functions such as viewing and editing a profile.

ATGRecommendationsManager

Retrieving recommendations from the Oracle Recommendations On Demand service.

ATGRestManager

Managing connections to the server.

ATGStoreManager

Retrieving store information.

ATGTargetingManager

Retrieving targeting (personalization) results from the personalization engine.

ATGReturnManager

Retrieve, create, submit, and confirm the user’s returns. It is the full return processing manager. It can provide full order details for a given return.

Each manager is implemented as a singleton. Consequently, ViewControllers use the appropriate manager’s singleton instance to request data from the server. Most importantly, when the ViewController requests that the manager fetch data for it, it sets itself as the request delegate so that it will receive the appropriate callback, either a success or failure block, when the response to the asynchronous request is available. When a response is returned from the server, the manager executes the success or failure block.

Each manager includes a delegate protocol definition that identifies those callbacks that should be invoked for each response from the server. In the case of the ATGProfileManager, this is the ATGProfileManagerDelegate. For example:

@protocol ATGProfileManagerDelegate <NSObject>

The delegate protocol defines callback methods for the manager. The protocol does not actually implement the method - they are implemented by other classes.

From within a delegate callback, the ATGManagerRequest handles the response by executing the success or failure block.


Copyright © 1997, 2014 Oracle and/or its affiliates. All rights reserved. Legal Notices