instance_flag=false; //true if 1 instance
public PrintSpooler() throws SingletonException {
if (instance_flag)
throw new SingletonException(\ else
instance_flag = true; //set flag for 1 instance System.out.println(\ }
//------------------------------------------- public void finalize() {
instance_flag = false; //clear if destroyed }
}
/**************** 改错结束 ******************/ 面向对象的原则
1,The Open/Closed Principle (OCP) 2,The Liskov Substitution Principle (LSP) 3,The Dependency Inversion Principle (DIP) 4,The Interface Segregation Principle (ISP)
5,The Reuse/Release Equivalency Principle (REP) 6,The Common Closure Principle (CCP) 7,The Common Reuse Principle (CRP)
36
设计模式
8,The Acyclic Dependencies Principle (ADP) 9,The Stable Abstractions Principle (SAP)
37
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库我写的设计模式的文章总结(8)在线全文阅读。
相关推荐: