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: iotivity-dev-bounces at lists.iotivity.org 
[mailto:[email protected]] 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<mailto: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 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

[cid:image001.gif at 01D0B968.8D6B4820]

[http://ext.samsung.net/mailcheck/SeenTimeChecker?do=1d07b0f8ffb1cd7f80806a5faff4d973f67e2c9d941f414a4aef5d5c9821adc2be7dd83ce6b932973c40f787d33f357d4b31597edd603a7ce5a22f09e2218feaa728c55b39cc59eacf878f9a26ce15a0]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150708/06e13344/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 13168 bytes
Desc: image001.gif
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150708/06e13344/attachment.gif>

Reply via email to