commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Lear <>
Subject Re: [HiveMind] Question about DAO creation
Date Fri, 03 Oct 2003 14:53:29 GMT
On Friday, October 3, 2003 at 16:45:42 (+0200) Christian Essl writes:
>Sorry I wrote my answer send it and than just saw that Harish was faster 
>(and better). Maybe the only thing you should keep from my anser that you 
>should shutdown the registry (the pool may need it, because HiveMind now 
>supports a shut-down event).

No reason to apologize --- very helpful stuff, except I'm not sure
I understand the need to shut down the registry.

I've refactored a bit, now my Global is simpler:

public class Global {
    private DAO dao;

    public Global() throws DAOException {
        Services services = new Services();
        DAOFactory factory =
            (DAOFactory) services.getService(DAOFactory.class);
        dao = factory.createDAO();

    public DAO getDAO() {
        return dao;

as is my Services class:

public class Services {
    private Registry registry;

    public Services() {
        ClassResolver resolver = new DefaultClassResolver();
        RegistryBuilder builder = new RegistryBuilder();


        Registry registry = builder.constructRegistry(Locale.getDefault());

    public Object getService(Class theClass) {
        return registry.getService(theClass.getName(), theClass);

Now I need to see about incorporating the other ideas about
connections, shutting down the registry (again, is this really
needed?)  etc.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message