commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <joerg.schai...@gmx.de>
Subject Re: [id] TODOs for 1.0?
Date Fri, 13 Jan 2006 22:00:43 GMT
Hi folks,

Jörg Schaible wrote:

> Rahul Akolkar wrote:
[snip]
>> 
>> http://www.nabble.com/forum/Search.jtp?forum=292&local=y&query=id
>> 
>> -Rahul
> 
> thanks, this produces useful results ...

Beeing in the process of reviewing and cleaning-up commons-id, I just wonder
about the role of the IdentinfierGeneratorFactory interface. I understand
the basic purpose to exchange the default implementation of the various
IdentifierGenerator types based on a system property, but I don't
understand, why the interface defines a method for nearly any
implementation. I would have expected something like

interface IdentinfierGeneratorFactory {
        StringIdentifierGenerator getStringIdentifierGenerator(...);
        LongIdentifierGenerator getLongIdentifierGenerator(...);
        UUIDIdentifierGenerator getUUDIdentifierGenerator(...);
}

but not

interface IdentinfierGeneratorFactory {
        StringIdentifierGenerator getStringIdentifierGenerator(...);
        LongIdentifierGenerator getLongIdentifierGenerator(...);
        UUIDIdentifierGenerator getUUDIdentifierGenerator(...);

        StringIdentifierGenerator getAlphaNumIdentifierGenerator(...);
        StringIdentifierGenerator getPrefixedAlphaNumIdentifierGenerator(...);
        StringIdentifierGenerator
getPrefixedTimeBasedAlphaNumIdentifierGenerator(...);
}

... you know what I mean.

Point is, either we add methods for *all* implementations or we provide with
the factory a set of methods for the sensible types and let our users
implement other factories to get other defaults.

And note: People programming IoC won't normally use this factory anyway,
they define the dependency on one of the IdentifierGenerator interfaces and
provide/configure the appropriate generator implementation.

Opinions?

- 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