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 through 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 |
---|---|
| All commerce-related functions such as cart actions, billing, shipping, and checkout. |
| 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. |
| Saving and retrieving values from the iOS keychain. |
| Retrieving product information including inventory levels and registering for back-in-stock notifications. Also retrieves product comparison requests. |
| User-related functions such as login/logout and account management functions such as viewing and editing a profile. |
| User-related functions such as login/logout and account management functions such as viewing and editing a profile, updating profile, creating a new user, and credit card and address operations. |
| Retrieving recommendations from the Oracle Recommendations On Demand service. |
| Managing connections to the server. |
| Retrieving store location information. |
| Retrieving targeting (personalization) results from the personalization engine. |
| 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. |
| Manages parsing through content items to retrieve objects inside of a content item. For example, the method |
| Makes available an instance of |
| This class decides which adaptor to return for content items based on the @type or @class attributes. |
| Contains methods to retrieve common |
Since each manager is implemented as a singleton, 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.