我有一个名为SingletonController1的单例类。
这个SingletonController1实例化了许多其他的单例类。
SingletonController1{
Authenticator - Singleton;
DBAccessor - Singleton;
RiskAccessor - Singleton;
}
我的问题是,如果我重新设计成这样会怎么样:
SingletonController2{
Authenticator -non-singleton;
DBAccessor -non-singleton;
RiskAccessor -non-singleton;
}
只要SingletonController2是唯一实例化这三个非单例类的类,那么这个设计在功能上不就与之前的设计相同吗?
祝好