I would like to take the MasterTable class and make it
an interface, making all current public methods of
MasterTable part of the interface. I would then like to
rename the current MasterTable class,
DefaultMasterTable. This makes the persistenece layer
used by the DefaultDatabase totally abstract.
To further hide and seperate the implementation details
from the front end (LDAP side), I suggest the creation
of a persistence factory. A well known interface would
be defined that creates/opens indexes and tables. The
persistence factory would then be responsible for
instantiating the object responsible for creating/opening
the tables and indexes. The actual class used for
creating tables and indexes could then be stored in the
server configuration somewhere. The sample code
would look something like this:
public interface PersistenceSource {
Index createIndex( String indexName, .... );
}
public class PersistenceFactory {
public static String persistenceSourceClass
= "ldapd.server.backend.DefaultPersistenceSource";
private static PersistenceSource singleton = null;
public static PersistenceStore getSource() {
if( singleton == null ) {
Object o =
Class.forName( persistenceSourceClass ).newInstance();
singleton = (PersistenceSource)o;
}
return singleton;
}
}
We could add actual members to the factory to
create/open tables and indexes if we want, since they
would just pass the call on to the singleton anyways.
Logged In: YES
user_id=630512
Any progress on this one?