-
Notifications
You must be signed in to change notification settings - Fork 53
Closed
Description
Prior to v2.0 the public API was structured as follows:
client.fetchEntries(); // asyncclient.fetchEntriesBlocking();client.fetchAssets(); // asyncclient.fetchAssetsBlocking();
This results in a very big CDAClient class, with many methods which is a pain to maintain. Considering future support for RxJava, this would make a bigger file with even more methods. This change should follow the same structure of the CMA SDK:
- Define a module class for every type of resource (i.e.
ModuleAssets,ModuleEntries, etc). - Top-level methods of a module should be used for making synchronous requests.
- A module should contain an inner-class named
Asyncthat should be accessible by invoking a top-level method namedasync(). - All methods of an
Asyncinner-class should take aCDACallbackinstance and be used for making asynchronous requests. CDAClientshould contain instances of all available modules.
When introducing RxJava support, every module should have another inner-class, similar to Async, but for methods that return Observable instances. (i.e. Obseravables class accessible via rx() method of the module).
As opposed to the CMA SDK, there is no point of creating several Retrofit service interfaces, as the number of methods for CDAService should now be fairly low, and is not subject to change.