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

Need declarative way to specify programmatically-generated default property values #27

Open
ChrisRus opened this issue Oct 8, 2014 · 0 comments

Comments

@ChrisRus
Copy link
Member

ChrisRus commented Oct 8, 2014

In an onm namespace data model declaration you can currently specify either, a static default value for a property, or programmatically-generate a default value via a callback function. The later case is used in cases like assigning a UUID, or timestamp to a data namespace at construction-time.

It's inconvenient to have to clutter onmd-* modules with additional npm dependencies (e.g. to call node-uuid or onm-bundled util functions). Better to extend the namespace declaration grammar to allow common things like UUID's/timestamps to be declared.

e.g.

    {
        namespaceType: 'component',
        jsontTag: 'example',
       namespaceProperties: {
           userImmutable: {
               componentUuid: {
                   generatedDefault: "uuid"
               }
           }
       }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant