You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's OK for small apps, but now imagine an app with tens of functions, along with tens of resources with ID Code. Maybe we don't need tens of functions to see the point, let's use just three functions:
The CDK ID Code doesn't have any meaning outside of the whole hierarchical context (it's not even unique), and the CDK Path is too long to be useful for humans (path is actually unique).
Now, thinking in terms of the Wing Console, which is a desktop UI that will show you how the whole application looks like, I feel we're missing something with the current naming conventions.
Proposal
What if we use the following names for a given resource:
Name (Code, which is the CDK ID). Shortest possible name, useful when you are in the context of a parent resource
Path (same as the CDK Path). Gives full hierarchical information for the resource
ID (which would be $name#$shortHashOfPath, for example Code#5d334a).
This ID is now meaningful enough to know which resource it represents, but it's also distinguishable from any other resource which shares the same name (since it's indeed unique). The Wing Console would use the name that makes more sense depending on the current view, but the resource ID should always be available for the user to see/copy.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The AWS CDK uses two strings to identify resources in a tree: ID and Path. See the following example:
It's OK for small apps, but now imagine an app with tens of functions, along with tens of resources with ID
Code
. Maybe we don't need tens of functions to see the point, let's use just three functions:The CDK ID
Code
doesn't have any meaning outside of the whole hierarchical context (it's not even unique), and the CDK Path is too long to be useful for humans (path is actually unique).Now, thinking in terms of the Wing Console, which is a desktop UI that will show you how the whole application looks like, I feel we're missing something with the current naming conventions.
Proposal
What if we use the following names for a given resource:
Code
, which is the CDK ID). Shortest possible name, useful when you are in the context of a parent resource$name#$shortHashOfPath
, for exampleCode#5d334a
).This ID is now meaningful enough to know which resource it represents, but it's also distinguishable from any other resource which shares the same name (since it's indeed unique). The Wing Console would use the name that makes more sense depending on the current view, but the resource ID should always be available for the user to see/copy.
Originally posted here.
Beta Was this translation helpful? Give feedback.
All reactions