這個是否是Composite 模式?

曙光發表於2002-10-14
我覺得是Composoite模式,不是理解是否正確?
又覺得像Factory?

public interface Initable {
   public void init();
}

public class BaseInitable implements Initable {
  public void init() {
    //init code
  }
}

public interface Service extends Initable {
  public Service getService(String name);
}

public class BaseService extends BaseInitable implements Service {
  public Service getService(String name) {
  //return service instance
 }
}
<p class="indent">

相關文章