基于逆变的单例
**
全新单例接口生成高度封装
**
逆变和协变
统一使用的接口
高度封装实现类只关心自己做什么
接口定义方法为外界提供使用
非常好用 不用反射加载了
//统一接口
namespace Singleton
{
public interface IMangerBase<out M>{}
}
namespace Utility
{
public class Singleton<T,M> where T class,new() where M:IManagerBas
原创
2022-02-18 01:19:27 ·
261 阅读 ·
1 评论