commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <Joerg.Schai...@Elsag-Solutions.com>
Subject RE: [id] Composite identifiers
Date Tue, 21 Feb 2006 10:06:31 GMT
Hi Phil,

Phil Steitz wrote on Monday, February 20, 2006 6:28 AM:

> Jörg Schaible wrote:
>> Jörg Schaible wrote on Monday, February 06, 2006 9:07 PM:
>> 
[snip]
>>> Looks fine. I've added the missing minLength/maxLength
>>> implementations and made it serializable. I would add a
>>> ConstantIdentifierGenerator. 
>>> 
>> 
>> What about adding adding a method to
> StringIdentifierGenerator to deal with StringBuffers?
>> 
>> StringBuffer nextIdentifier(StringBuffer buffer);
>> 
>> The implementation should append the next identifier to the
> buffer and return it. This would make the concatenation more
> efficient and may be also useful for other use cases where
> the returned id is added to a String.
>> 
> Finally getting back into this.  Sorry for the latency. 

:)
Had some other tasks, too. I basically stopped since the next thing is working either on the
composite thingy or the UUID classes.

> I like the idea
> above from the standpoint of efficiency, but it looks a
> little odd as an
> API.  Could be nothing wrong with it, just looks odd at first
> blush to me. 

jMock uses such an API for its Constraint.describeTo. Therefore I am used to it. Since it
does make sense for StringIdentifierGenerators only and the implementation are/should be performance
optimized, it is worth it IMHO.

> Might be better to change the name to
> appendNextIdentifier, so the
> append semantics are clear.

Well, you don't have to append, an impl might even return another StringBuffer (although append
*is* the most natural case).

> I will add ConstantIdentifierGenerator in any case.

OK.

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message