摘要: 1 普通的单例写法 缺点:每个单例类里都要写instance和getInstance。 2 Module写法 优点:不需要使用getInstance,调用更简单 缺点:外部不能直接调用属性,只能调用方法 3 继承BaseClass 优点:继承后不用写instance和getInstance。 缺点: 阅读全文
posted @ 2019-03-25 16:14 HaOnBaby 阅读(329) 评论(0) 推荐(0)