Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide for multiple instances of a definition within a declaration #96

Open
mjkoster opened this issue Dec 13, 2019 · 5 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@mjkoster
Copy link
Contributor

To support array style constructs in implementations, the data model definition needs to allow for some kind of multi-instance concept in declarations, to use a definition in a way that may result in multiple instances within an implementation.

This could be multiple instances of a property to model OMA LWM2M resources, or something like an outlet strip model with some unspecified number of outlet elements.

@mjkoster mjkoster self-assigned this Dec 13, 2019
@mjkoster mjkoster added the bug Something isn't working label Dec 13, 2019
@mjkoster
Copy link
Contributor Author

mjkoster commented Mar 5, 2020

I propose to take an explicit approach and define two new qualities, applied to types odmProperty, odmObject, and odmThing:

  • multiInstance (type boolean, optional, default false)
  • maxInstances (type positive integer, optional)

multiInstance without a maxInstances constraint is valid
maxInstances without multiInstance is unambiguous, but we should require multiInstance to be present if maxInstances is used

These qualities should be allowed to be added to new definitions that reuse other definitions, e.g. multiInstance in the definition of an outlet thing, and maxInstances defined when the outlet thing definition is used in an outlet strip thing definition.

@WAvdBeek
Copy link
Collaborator

WAvdBeek commented Mar 5, 2020

i think this will work for odmThing, where multiple instances of the odmObject can be instantiated.
not sure if this should be done inside odmObject or odmThing, here we can use an array/link concept

@mjkoster
Copy link
Contributor Author

mjkoster commented Mar 5, 2020

We need to support multiple instances of odmProperty to model multi-instance Resource types in LWM2M. In LWM2M, they are addressable as an array or as individual elements. There is no need to require any particular structure in the SDF model, thus can leave it to the binding.

We also need to allow odmThing to have multiple instances of odmObject or odmThIng for use cases like the outlet strip. We could work out some examples to discuss from.

@WAvdBeek
Copy link
Collaborator

WAvdBeek commented Mar 5, 2020

if LWM2M can access the data as an array then we should also model that with SDF.

@akeranen
Copy link
Contributor

akeranen commented Mar 6, 2020

Having the same multi* qualities on both Thing/Object and A/E/P level sounds like a good way forward to me. That allows modeling well the LwM2M models and those models that don't have this feature don't have to use it. I guess we'll learn more how well that works when we do more cross-ecosystem model conversions and then can re-visit this, if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants