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

Managers

The iOSRestManager has the important responsibility of establishing a connection to the server. Each of the other managers uses the iOSRestManager to make a request to the server via REST. The iOSRestManager 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 Assisted Selling. 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 Assisted Selling and a brief summary of their responsibilities.

Manager

Responsibility

ATGCommerceManager

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

ATGExternalProfileManager

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

ATGInternalProfileManager

This is the same as ATGExternalProfileManager, except that it operates against internal users (including agent), and the ATGExternalProfileManager operates against external users (shoppers).

ATGLoginDelegate

Provides callback for actions that require a login.

ATGManagerRequest

The base class for all manager requests.

ATGProductManager

Retrieves 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.

ATGRestManager

Manages connections to the server.

ATGKeychainManager

Saves and retrieves values from the iOS keychain.

ATGStoreManager

Retrieves store information.

ATGAgentCommerceManager

Agent-specific version of the commerce manager class.

ATGAgentEnvironmentManager

Manager for agent environment related server calls.

ATGAgentEnvironmentManagerDelegate

Delegates callback when the current catalog has been set.

ATGAgentEnvironmentManagerRequest

The results of requesting environment data.

ATGAgentSiteManager

Manages site-related server calls.

ATGAgentSiteManagerDelegate

The callback delegate for site-related server calls.

ATGAgentSiteManagerRequest

Request handler for ATGAgentSiteManager.

ATGCustomerManager

Manages customer related server calls.

ATGCustomerManagerDelegate

Callback delegate for customer-related server calls.

ATGCustomerManagerRequest

Request handler for ATGCustomerManager.

ATGAgentPlugins

Controls the plugin model implementation.

ATGPOSManager

Manages the bulk of the ORMPOS integration logic.

ATGSledManager

Coordinates the Sled integration.

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 receives 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, rather 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, 2015 Oracle and/or its affiliates. All rights reserved. Legal Notices