-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Conversation
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
There was a problem hiding this 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?).
I think we should prevent non abstract non identified asset/participant/events/transactions. It is a breaking change...
Here I am inclined to say that we should allow containment of identified classes. If person A creates a model using |
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
Not sure why ObjectValidator coverage has been lowered by these changes. I need to look into that. |
There was a problem hiding this 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 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great.
Signed-off-by: Dan Selman <[email protected]>
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)
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]>
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]>
Issue #181
Rework identifiers and relationships. See issue for details and design.
Changes
identified by
for Conceptsidentified
— automatically create an identifying field called$identifier
Concept
from the mode (Resource
andConcept
are now functionally identical)Factory
to always delegate tonewResource
whennewConcept
is called, checking whether theConcept
has an identifying fieldFlags
Factory
?