Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: 1.0-beta-3.0.7
-
Component/s: Container
-
Labels:None
-
Number of attachments :
Description
In systems, where the potential number of implementors of some components is "theoretically" endless (think about some system and user contributed components for example) number of role providers, it is usually okay to use implementor class name as roleHint.
Currently, as of p-c-d beta-1 and java5 annotations, it is possible only by Copy+Paste of the class name into the java5 Component anno as string literal. This is cubersome (think about potential problems when doing mass refactoring and ending up with components with overlapping hints for example).
A possible way – to have unobtrusive change on annotations and config generator – would be to introduce a new Component flag (to leave current "hint" unaffected) is to have some boolean flag ie. "implementorIsHint=true" (that defaults to false).
In case of "true", the component descriptor creator would simply take the implementor FQN and use that as roleHint.
Activity
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | 1.0-beta-3.0.6 [ 14897 ] | |
| Fix Version/s | 1.0-beta-3 [ 14652 ] |
| Fix Version/s | 1.0-beta-3.0.7 [ 14918 ] | |
| Fix Version/s | 1.0-beta-3.0.6 [ 14897 ] |
Just to explain: a lot of times, the ability to "hint" the component with some logical name is good (best example Plexus Archiver, where the hint simply maps to file format).
But there are many use cases, when the developer is not interested at all in the hint of the component, moreover, when they are simply "collected" as requirement into a collection (lookupMap, lookupList and their counterpart requirements et al).
In latter case, forcing the developers to "hint" their component is just a PITA. It would be much more cooler, if there would be a flag in @Component anno, that when set, would simply use the implementor FQN as hint or something like that.