One has to go to more advanced use case that uses the factory pattern. For example, playback of an song. This can be implemented by an factory (not sure if they are going into that direction though) The playback factory indicates the amount of concurrent playback sessions possible When an song starts to play, an playback session is created by means of the factory. When the song stops playing, the playback session is deleted. Note that the factory pattern is a quite common pattern in REST
Kind Regards, Wouter From: iotivity-dev-boun...@lists.iotivity.org [mailto:iotivity-dev-boun...@lists.iotivity.org] On Behalf Of Gregg Reynolds Sent: 01 March 2018 00:54 To: Thiago Macieira <thiago.macie...@intel.com> Cc: iotivity-dev <iotivity-dev@lists.iotivity.org> Subject: Re: [dev] Regarding resource creation On Wed, Feb 28, 2018 at 4:09 PM, Thiago Macieira <thiago.macie...@intel.com<mailto:thiago.macie...@intel.com>> wrote: On Wednesday, 28 February 2018 12:19:48 PST Nash, George 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. > > However, CRUDN is CREATE, READ, UPDATE, DELETE, NOTIFY. > > I CREATE the resource at service start as part of the initialization code. > Should I wait for a client action before creating a resource? > > What about DELETE? I don't think any of my services can delete resources. That's normal, for both situations. Some services will have create/delete interaction, most will not. You're going to see them usually only on non-physical services, like creating a group of devices, a scene, an ACL, etc. Is it possible to CREATE an ACL? Or more generally, an SVR? You can UPDATE /oic/sec/acl2, but CREATE is a 'nother story. The only use case I can see for CREATE (for applications) is "virtual" application-level stuff, like a "room" containing a bunch of sensors, etc. Or a "floor" containing rooms. I suppose theoretically you could CREATE a resource that manipulates SVR stuff indirectly (bypassing the OCF securiity mechanisms). What else does it make sense to CREATE? If you have a physical or fixed service, then it already exists and cannot be deleted (short of transferring ownership to another user) Cannot be CREATEd, ok, but why can I not DELETE whatever I please? g
_______________________________________________ iotivity-dev mailing list iotivity-dev@lists.iotivity.org https://lists.iotivity.org/mailman/listinfo/iotivity-dev