directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel L├ęcharny <elecha...@gmail.com>
Subject LdapConnectionFactory is most certainly useless
Date Mon, 12 Mar 2012 09:33:56 GMT
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