On Feb 28, 2018 2:19 PM, "Nash, George" <george.n...@intel.com> wrote:
So far in all of the services that I have developed I have always created the resource as soon as the service is started. Presumably you mean in code, not involving a CREATE msg. However, CRUDN is CREATE, READ, UPDATE, DELETE, NOTIFY. I CREATE the resource at service start as part of the initialization code. Technically CREATE is a message. "Creating" (that is, registering) resources on a server does not involve CREATE. Should I wait for a client action before creating a resource? I'm not sure how that would work. When a request for /foo arrives, it will be dropped if the server does not already have a foo handler registered. Maybe. I guess you could make the default handler register stuff based on incoming requests. What about DELETE? I don’t think any of my services can delete resources. Why not? All of the samples that I have looked at use GET, PUT, and POST. GET corresponds to the READ. In all the examples I has seen both PUT and POST both map to UPDATE they can cause the resource to NOTIFY observers about any change. NOTIFY is a whole 'nother animal AFAIK. Not inherently entailed by UPDATE. Are there any samples that show CREATE and DELETE? Since security permissions map directly to the CRUDN I wanted to understand how CRUDN actually maps to code. More generally: what are the use cases? Creating a remote resource is counter-intuitive - you cannot just create a temperature resource. Otoh, you can create aggregates, like a resource for all the lights on the 3rd floor. That's the obvious case, but I wonder what other cases for CREATE, UPDATE, etc. there are. G
_______________________________________________ iotivity-dev mailing list iotivity-dev@lists.iotivity.org https://lists.iotivity.org/mailman/listinfo/iotivity-dev