directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre-Arnaud Marcelot ...@marcelot.net>
Subject Re: LdapConnectionFactory is most certainly useless
Date Mon, 12 Mar 2012 10:16:34 GMT
Hi Emmanuel,

I wasn't even aware of this class actually.

I'm not sure it's that useful.

+1.

Regards,
Pierre-Arnaud

On 12 mars 2012, at 10:33, Emmanuel L├ęcharny wrote:

> Hi guys,
> 
> I think that the LdapConnectionFactory class is not only useless, but it's also a source
of problem.
> 
> Methods such as :
>    /**
>     * Gets the core session connection.
>     *
>     * @return a connection based on the the CoreSession
>     */
>    public static LdapConnection getCoreSessionConnection()
>    {
>        try
>        {
>            Class<?> cl = Class.forName( "org.apache.directory.server.core.api.LdapCoreSessionConnection"
);
>            return ( LdapConnection ) cl.newInstance();
>        }
>        catch ( Exception e )
>        {
>            throw new RuntimeException( e );
>        }
>    }
> 
> Are too dependent on the class name, and should not be used. If we change its name, we
could be in trouble.
> 
> I suggest we get rid of this class and use the constructors instead.
> 
> -- 
> Regards,
> Cordialement,
> Emmanuel L├ęcharny
> www.iktek.com
> 


Mime
View raw message