Actions should not be Identifiable ?
Tom Zeller
tzeller at dragonacea.biz
Sat Mar 22 15:26:35 EDT 2014
> On Mar 22, 2014, at 1:59 PM, "Cantor, Scott" <cantor.2 at osu.edu> wrote:
>
>> On 3/22/14, 6:13 AM, "Rod Widdowson" <rdw at steadingsoftware.com> wrote:
>>
>> I would go further. It is not #setId() which is important here, it's
>> #getId(). AFAICS the only need for the first is the second and if the
>> second isn't needed we should ditch it. That would simplify a lot of
>> stuff,
>> especially the tests.
>
> Right.
>
>> I had a thought last night which re-raises a suggestion that Tom made 9
>> months past which we might want to factor in to the discussions. If a
>> major
>> use of #getId() is in logging (and as far as I can see it is always a
>> superset of the needs of a particular class), should we consider putting
>> #getLogPrefix() (plus supporting infrastructure) in there too?
>
> Probably, at least as a protected method in the abstract base.
Not sure of the context, but I was leaning to a public method which may throw an unchecked exception, to flatten the parent type hierarchy.
RuntimeException is okay with me for configuration errors, which should be thrown during initialize(), which is where a Component ID should be injected from the XML Spring config file.
Defaulting the ID to the default impl of toString() sounds ok to me.
Component.getId() then can be @nonnullafyerinit.
More information about the dev
mailing list