[WIP] feat(AIP-122): require parent in resource name#1068
Open
toumorokoshi wants to merge 1 commit intoaip-dev:masterfrom
Open
[WIP] feat(AIP-122): require parent in resource name#1068toumorokoshi wants to merge 1 commit intoaip-dev:masterfrom
toumorokoshi wants to merge 1 commit intoaip-dev:masterfrom
Conversation
It is a common use case to first look up the parent resource, then perform an operation on a child. If the child does not incude the resource name of the parent, the consumer of the resource must choose from a set of non-optimal approaches to find the parent: 1. Perform a read of the child resource, then look up a custom field on the child to find the parent (assuming such a field exists). 1. Add another field where one specifies the parent of a resource in addition to the child resource.
43fea20 to
514c2b3
Compare
Contributor
|
What does "include" mean? The parent's name (collection) must be a prefix of the child's name? |
Contributor
Author
Yes. I guess I could rephrase this with something like "must be prefixed with the parent". |
Contributor
|
"must be prefixed with the parent" would be clearer |
Contributor
Author
|
I'm pausing this PR for now until I have a bit more bandwidth - there's some concerns about this patterns in that it makes move semantics more difficult (e.g. moving from one parent to another). I feel this is an antipattern but there's precedent at Google for this already (e.g. GCS buckets). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It is a common use case to first look up the parent resource, then perform an operation on a child. If the child does not incude the resource name of the parent, the consumer of the resource must choose from a set of non-optimal approaches to find the parent: