Very interesting approach.

Thanks

Mike Snare <[EMAIL PROTECTED]> wrote: The service implementation is a cover for 
the singleton.  Imagine:

/**
 * A simple HiveMind service
 */
public interface ISomeService {

  void doSomething();

}

/**
 * The implementation of the hivemind service, delegates to the singleton.
 */
public class SomeServiceImpl implements ISomeService {

  public void doSomething() {
    SomeServiceSingleton.Instance().doSomething();
  }

}

/**
 * The implementation of the hivemind service as a singleton
 */
public class SomeServiceSingleton implements ISomeService {

  private static SomeServiceSingleton instance;

  private SomeServiceSingleton(){}

  public static synchronized SomeServiceSingleton Instance() {
    if (instance == null) {
      instance = new SomeServiceSingleton();
    }
    return instance;
  }

  public void doSomething() {
    // do it.
  }

}

-Mike

On 5/4/06, Oscar Picasso  wrote:
> I guess you get your singleton using a static method. But how do you write 
> your hivemodule.xml to do that ?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



                
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ 
countries) for 2ยข/min or less.

Reply via email to