Shrinkdesc 38 - Descriptor.getDescriptorName #14
Closed
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.
I've added Descriptor name to the Descriptor interface, but how it is implemented makes me wonder..
Each time we go down a level in the Descriptor, e.g web.servlet().name() we create a new instance of the lower levels Desc object for so to pass along the current levels state down:
return new ServletDesc(getDescriptorName() /* main descriptor name /, getRootNode() / parent node /, servletNode / new current node /*)
(getRootNode we could infer from servletNode.parent in the constructor of the child.)
The impl works as is, but what i'm trying to say is.. it won't scale and seems a bit awkward. We don't have this issue in SW since we only have one level wrapped and always refer to the same Archive in the end.
Not sure which other Descriptor 'global' metadata like Name we need, but if we get more we should consider wrapping some of these object in some other way..