bike part reward : setting bean ID property automatically

Ian Young ian at iay.org.uk
Fri Feb 14 06:56:25 EST 2014


On 13 Feb 2014, at 23:39, Tom Zeller <tzeller at dragonacea.biz> wrote:

>> 1) (Channelling Ian) We need to add an interface to ComponentSupport which
>> implies settability of identity (and we need to change the javadoc on
>> IndentifableComponent which is wrong in a number of ways).  I am not
>> proposing adding to the AbstractClasses.  This feels like a requirement no
>> matter what else we do.
> 
> Could you say more regarding why we need to add an interface to
> ComponentSupport ?

We currently represent the ability to "be identifiable" (i.e., to have an identifier which can be queried) as an interface IdentifiableComponent. Although I'm not a fan of the name, this is a natural thing to do because you want to have that property to be independent of the class hierarchy.

Likewise, if you want to represent the ability to "be nameable" (i.e., to have an identifier which can be set externally) then if you want that property to be independent of the implementation class hierarchy it should be an interface (or part of an interface) too.

If you don't do this, you end up writing code that is dependent on the implementation class hierarchy, and I don't think that's a good idea. If you're writing code that says "if the thing is an instance of AbstractMumbleFratz" then do X I'd generally regard that as a flag.

> My assumption was the interface would be like
> IdentifiableComponent, but replacing getId() with setId().

I'm not sure what you're saying here, but for the avoidance of doubt I think there are a couple of obvious ways to invent NameableComponent (again, not a particular fan of the name):

* As a peer to IdentifiableComponent, extending Component

* As an extension to IdentifiableComponent, on the basis that being able to set a name you can't query is kind of useless

> I am okay with log.warn in the long term, curious why you suggest
> short term only.

I'd be mildly against leaving something like a warning in there to clutter up log files. It's not as if we're "warning" about a condition which can cause any problems. I have *hundreds* of such bean declarations today.

	-- Ian



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5943 bytes
Desc: not available
Url : http://shibboleth.net/pipermail/dev/attachments/20140214/89306bea/attachment.bin 


More information about the dev mailing list