-
Notifications
You must be signed in to change notification settings - Fork 89
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
RFC 0693: Property injectors #699
base: main
Are you sure you want to change the base?
Conversation
text/0693-property-injection.md
Outdated
|
||
`IPropertyInjector` - An IPropertyInjector defines a way to inject additional properties that are not specified in the props. It is specific to one Construct and operates on that Construct’s properties. This will be called `Injector` for short. | ||
|
||
`propertyInjectors` - A collection of Injectors attached to App, Stage, or Stack. Any matching Construct created in this App, Stage, or Stack will have the Injector applied to it. |
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.
I believe we also agreed on that the injectors can be also attached to any construct. It can be attached to any node in the scope tree.
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.
Yes, I have an example of that in the FAQ. The common way is to attach them to App, Stage, or Stack.
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.
Please write something to clarify that here, it confuses me every time I read it. You can try verbiage like the following:
A collection of injectors attached to the construct tree. Injectors can be attached to any construct, but in practice we expect most of them will be attached to
App
,Stage
orStack
.
That acknowledges both the genericity of the proposed solution as well as the expected use cases.
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.
will do. thanks
Pull request has been modified.
text/0693-property-injection.md
Outdated
@@ -0,0 +1,468 @@ | |||
# Blueprint via Property Injection |
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.
This document is proposing "blueprints" and "property injection" at the same time.
I think the reader would benefit from a small definition of both terms and how they relate.
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.
I try to define that in line 7.
Blueprint is a way for orgs to enforce standards by setting default values to CDK Constructs. The Blueprint standards can be shared and applied to many development teams. This is done via injecting default property values at creation time.
What is a better way to communicate this?
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.
I would phrase it as something like:
This document describes the mechanism of property injection, which is ...
This mechanism allows the implementation of blueprints, which are ...
The trick is now to define "blueprints" in a way that is substantially different enough from "applied property injectors" to add descriptive value.
I wonder if that's even possible, and if it's not just distracting. It might come down to "blueprints are a branded term for a particular library of property injectors"... which... fair enough, but is that worth describing in this doc?
text/0693-property-injection.md
Outdated
|
||
`IPropertyInjector` - An IPropertyInjector defines a way to inject additional properties that are not specified in the props. It is specific to one Construct and operates on that Construct’s properties. This will be called `Injector` for short. | ||
|
||
`propertyInjectors` - A collection of Injectors attached to App, Stage, or Stack. Any matching Construct created in this App, Stage, or Stack will have the Injector applied to it. |
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.
Please write something to clarify that here, it confuses me every time I read it. You can try verbiage like the following:
A collection of injectors attached to the construct tree. Injectors can be attached to any construct, but in practice we expect most of them will be attached to
App
,Stage
orStack
.
That acknowledges both the genericity of the proposed solution as well as the expected use cases.
This is a request for comments about Set Default Values to Construct Properties using PropertyInjector. See #693 for
additional details.
APIs are signed off by @{rix0rrr}.
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache-2.0 license