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

IDs & relationships for #181 #196

Merged
merged 6 commits into from
Jun 30, 2020
Merged

IDs & relationships for #181 #196

merged 6 commits into from
Jun 30, 2020

Conversation

dselman
Copy link
Contributor

@dselman dselman commented Jun 10, 2020

Issue #181

Rework identifiers and relationships. See issue for details and design.

Changes

  • PEG grammar updated
    • allow identified by for Concepts
    • add support for identified — automatically create an identifying field called $identifier
  • Remove Concept from the mode (Resource and Concept are now functionally identical)
  • Update Factory to always delegate to newResource when newConcept is called, checking whether the Concept has an identifying field
  • Allow relationships to any class that has an identifying field (reject otherwise)

Flags

  • Nothing yet to automatically generate IDs. Should that be a feature of the Factory?

Copy link
Member

@jeromesimeon jeromesimeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great so far. Only one requested changes (version in package.json) and a few questions/comments.

I think some more testing, etc. but a great start. Couple of open questions:

  • allow asset/participant/events/transactions without identifier or not?
  • prevent "inlined" form for identified classes? (i.e., force having a relationship to them?).

@dselman
Copy link
Contributor Author

dselman commented Jun 16, 2020

Looks great so far. Only one requested changes (version in package.json) and a few questions/comments.

I think some more testing, etc. but a great start. Couple of open questions:

  • allow asset/participant/events/transactions without identifier or not?

I think we should prevent non abstract non identified asset/participant/events/transactions. It is a breaking change...

  • prevent "inlined" form for identified classes? (i.e., force having a relationship to them?).

Here I am inclined to say that we should allow containment of identified classes. If person A creates a model using asset they can't know whether person B would like to use it with a containment or using a relationship. I've seen quite a few models that would like to store a collection of transactions, for example.

@dselman dselman marked this pull request as ready for review June 18, 2020 14:56
@dselman
Copy link
Contributor Author

dselman commented Jun 18, 2020

Not sure why ObjectValidator coverage has been lowered by these changes. I need to look into that.

@jeromesimeon jeromesimeon self-requested a review June 19, 2020 16:39
Copy link
Member

@jeromesimeon jeromesimeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! The tests for handling identifiers in various classes make sense (and I think look good from a user point of view).

From where I stand this looks good to go as soon as the coverage gets back up.

The coverage drop seems to be related mostly to error cases not being triggered. https://coveralls.io/builds/31536708/source?filename=packages%2Fconcerto-core%2Flib%2Fserializer%2Fobjectvalidator.js#L392

I'm unsure if it means some tests need to be changed/added or if those errors have become essentially useless (are dead code with the new identifier/relationship support).

@@ -0,0 +1,215 @@
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great.

@dselman dselman changed the title (wip) ids & relationships for #181 IDs & relationships for #181 Jun 30, 2020
@dselman dselman merged commit fead88e into release-1.0 Jun 30, 2020
jeromesimeon pushed a commit that referenced this pull request Dec 23, 2020
PEG grammar updated
- allow identified by for Concepts
- add support for identified — automatically create an identifying field called $identifier

Remove Concept from the mode (Resource and Concept are now functionally identical)

Update Factory to always delegate to newResource when newConcept is called, checking whether the Concept has an identifying field

Allow relationships to any class that has an identifying field (reject otherwise)
jeromesimeon pushed a commit that referenced this pull request Dec 23, 2020
PEG grammar updated
- allow identified by for Concepts
- add support for identified — automatically create an identifying field called $identifier

Remove Concept from the mode (Resource and Concept are now functionally identical)

Update Factory to always delegate to newResource when newConcept is called, checking whether the Concept has an identifying field

Allow relationships to any class that has an identifying field (reject otherwise)

Signed-off-by: Dan Selman <[email protected]>
@jeromesimeon jeromesimeon deleted the ds-identifiables branch December 23, 2020 17:58
jeromesimeon pushed a commit that referenced this pull request Jan 7, 2021
PEG grammar updated
- allow identified by for Concepts
- add support for identified — automatically create an identifying field called $identifier

Remove Concept from the mode (Resource and Concept are now functionally identical)

Update Factory to always delegate to newResource when newConcept is called, checking whether the Concept has an identifying field

Allow relationships to any class that has an identifying field (reject otherwise)

Signed-off-by: Dan Selman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants