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

UUIDs as a primitive type #528

Closed
mttrbrts opened this issue Sep 26, 2022 · 2 comments
Closed

UUIDs as a primitive type #528

mttrbrts opened this issue Sep 26, 2022 · 2 comments
Labels
Type: Feature Request 🛍️ New feature or request

Comments

@mttrbrts
Copy link
Member

It's common for models to need to define properties or identifiers that follow a uniqueness constraint, e.g. following the UUID (universally unique identifiers) standard. https://en.wikipedia.org/wiki/Universally_unique_identifier

Built-in support for UUIDs would allow users to take advantage of known semantics of UUIDs and avoid having to redefine complex regular expressions. Using a built-in type (rather than a faceted typedef, #433 ) would allow us to also generate default values (such as for UUIDv4).

Feature Request 🛍️

concept Foo identified by identifier {
  o UUID identifier format=v4
  //...
}

Use Case

Possible Solution

Context

Detailed Description

@mttrbrts mttrbrts added the Type: Feature Request 🛍️ New feature or request label Sep 26, 2022
@dselman
Copy link
Contributor

dselman commented Sep 27, 2022

Adding a new primitive types is likely quite expensive (requires all code gen visitors to be updated to handle this type, as well as changing the metamodel). A middle path could be to add support for typedefs (a faceted String) and then to put some of these common typedefs into a concerto.types namespace. This would allow codegen and instance gen to be updated progressively. We could then decide whether concerto.types was an implicit import into all namespaces...

@mttrbrts
Copy link
Member Author

Closing in favour of #433 as per @dselman's suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Request 🛍️ New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants