Pat, Thank you for your detail review.
The concept of this API is covering most frequent use cases easily, so that it may not cover the corner case of detail resource operation. Of course we should use the base layer C++ API together such as OCPlatform initialization and so on. For your each comment, I?d like to answer as follows. This API implemented on top of Base Layer C++ API not from C SDK. Builder?s parameters is not easy to answer. However, detail could be updated after consideration. I also have the same concern for the Watch terminology. Please think about it as the intermediate API version. >From the Catch concept, we can realize the synchronous API return. Assuming user mostly use this Sync get API, they can easily do programming, I believe. We also provide not only the Individual value get/set but also get/setter for whole attributes together e.g) getAttributes( ). Furthermore, adding the group and action set concept on top over these API later, we can realize the Object oriented style API on the current API based on Messaging concept. Regarding the resource server plug-in, Markus can provide the detail info. BR, Uze Choi From: Lankswert, Patrick [mailto:[email protected]] Sent: Wednesday, July 08, 2015 11:56 PM To: ram.kannan at samsung.com; Uze Choi; iotivity-dev at lists.iotivity.org Subject: RE: [dev] Primitive Service - Resource Manipulation API review request Uze, In general, I would like to see a text description for each of these methods. Also, are you proposing a replacement to the existing APIs? If so, which APIs. The wiki page says that it sits on the base layer. Is that that C SDK? Although our APIs need some clean up, I am not sure that this re- envisioning of the API helps. The ResourceObject::Builder looks pretty good but why does the constructor have so many parameters? It seems like some (all?) of these parameters should be exposed as attributes with accessor methods. It is also missing a lot of functionality. Until we see how all of the functionality fits, it is not clear if you are making one part of the API look good but the rest is worse than the existing functionality. The RemoteResourceObject on the other hand has numerous issues. First, you are introducing new terminology ?watch?. It is not clear what ?watch? means. The GOF cover observe, publish, subscribe, notify, etc. CoAP has observe. The standard mentions a new publish/subscribe model. I have never heard of ?watch?. Is there a reason for the new term? Also, you have embedded a caching mechanism into the object. I am not sure that enabling caching in this way provides much value for the overhead, confusion and abuse that it will introduce. A caching adaptor pattern would provide better separation of concern. In addition, please clarify the remote attribute API, it is not clear whether the getter methods will pull from the cache first. The thought that you would encourage individual attribute value access is concerning. Given three attributes in a representation, this API would encourage users to naively make three OTA requests. A good API should abstract the details but should also discourage, limit or prohibit patterns that cause poor internal processes. Do you have a more detailed description of the resource server plug-in? Pat From: [email protected] [mailto:iotivity-dev- bounces at lists.iotivity.org] On Behalf Of Ramasamy Kannan Sent: Wednesday, July 08, 2015 7:27 AM To: Uze Choi; iotivity-dev at lists.iotivity.org Subject: Re: [dev] Primitive Service - Resource Manipulation API review request Hi Mr.Uze Choi, I am assuming for each remote resource the caching is done for all requested attributes and its values. What is the size of the cache? Is it dynamic or fixed size? If the resource attribute values are streaming, will the cache support this? If it is fixed cache is it possible to input the size of the cache through input parameter? Is there some documentation for better understanding the API? When will the example code for using the API be ready? Regards, Ram ------- Original Message ------- Sender : Uze Choi<uzchoi at samsung.com> S6/Principal Engineer/IoT Solution Lab./Samsung Electronics Date : Jul 08, 2015 18:53 (GMT+09:00) Title : [dev] Primitive Service - Resource Manipulation API review request Hi All, >From the primitive service project, we are currently develop the easy wrapping API on top of the base layer API, which is targeting the smart device such as Android and so on. Concept is described on the wiki <https://wiki.iotivity.org/resource_manipulation> https://wiki.iotivity.org/resource_manipulation already and Here is the list of the API. Smart device Application developer may use the this Resource manipulation API and base Layer API together. Any question and feedback are welcome. [Easy Wrapper Class for Resource Operation from Server and Client Side] Class API Parameter Return ResourceObject::Builder Builder const std::string& uri, const std::string& type, const std::string& interface 0 setDiscoverable bool Builder& setObservable bool Builder& setAttributes ResourceAttributes& Builder& Build void std::shared_ptr<ResourceObject> ResourceObject startPresence const unsigned int ttl void setAttribute std::string& key, const T &value void getAttribute std::string& key, template< typename T > getAttributes std::string& key, ResourceAttributes& has Attribute std::string& key, bool setGetAttributesRequestHandler GetAttributesRequestHandler (Function ptr) void setSetAttributesRequestHandler SetAttributesRequestHandler (Function ptr) void Notify void void addAttributeUpdatedHandler const std::string& key,AttributeUpdatedHandler(Function ptr) void removeAddAttributeUpdatedHandler const std::string& key void RemoteResourceObject startWatching ResourceStateChangedCallback void stopWatching void void getState void ResourceState ? startCaching 1.void 2.CacheCB cb void stopCaching void void refreshCache void void getCachedAttributes void ResourceAttributes getResourceCacheState void CACHE_STATE getCachedAttribute const std::string& key templete T getCachedAttributeValue const std::string& key, (Function ptr) templete T ? getRemoteAttributes void ResourceAttributes getRemoteAttribute const std::string& key templete T setRemoteAttribute std::string& key, const T &value void setRemoteAttributes ResourceAttributes &attribute void DiscoveryManager discoverResource const std::string& host, const std::string& resourceURI, OCConnectivityType connectivityType, DiscoverCallback callback void getInstance void DiscoveryManager * Common in ResourceObject and RemoteResourceObject getUri void string getAddress void string getTypes void vector< string > getInterfaces void vector< string > [Resource Server Plug-in Manager] ResourceContainer startContainer string configFile void stopContainer void void listBundles void list<BundleInfo*> startBundle string bundleId void stopBundle string bundleId void addBundle string bundleId, string bundleUri, string bundlePath, std::map<string, string> params void removeBundle string bundleId void addResourceConfig string bundleId, string resourceUri, std::map<string, string> params void removeResourceConfig string bundleId, string resourceUri void listBundleResources string bundleId list<string> getInstance void ResourceContainer * BundleInfo setID string name void getID void string setPath string path void getPath void string setVersion string version void getVersion void string build void BundleInfo* BR, Uze Choi <http://ext.samsung.net/mailcheck/SeenTimeChecker?do=1d07b0f8ffb1cd7f80806a5 faff4d973f67e2c9d941f414a4aef5d5c9821adc2be7dd83ce6b932973c40f787d33f357d4b3 1597edd603a7ce5a22f09e2218feaa728c55b39cc59eacf878f9a26ce15a0> -------------- next part -------------- HTML ?????? ??????????????... URL: <http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150709/f2b57276/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 13168 bytes Desc: ?????? ?? ????????. URL: <http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150709/f2b57276/attachment.gif>
