工厂方法模式:
AbstractBeanFactory.getObject()
@Override
public final T getObject() throws Exception {
if (isSingleton()) {
return (this.initialized ? this.singletonInstance : getEarlySingletonInstance());
}
else {
return createInstance();
}
}
protected abstract T createInstance() throws Exception;
createInstance() 由 AbstractBeanFactory 的子类去实现。