###
DOI:
计算机系统应用英文版:2014,23(5):218-221
本文二维码信息
码上扫一扫!
单例模式及其扩展在Web开发中的应用分析
(郧阳师范高等专科学校 计算机科学系, 十堰 442700)
Application Analysis of Singleton Pattern and its Extension in Web Development
(Department of Computer Science of Yunyang Teachers' College, Shiyan 442700, China)
摘要
图/表
参考文献
相似文献
本文已被:浏览 1311次   下载 2520
Received:September 20, 2013    Revised:October 25, 2013
中文摘要: 单例模式是一种Web开发中广泛应用的设计模式,应用该模式的类只能在类体内部实例化本类唯一的实例对象,并通过该类的静态成员方法提供给整个应用程序,起到全局共享的作用. 该种模式的应用可以降低应用程序的资源耗费、提高运行效率,但当系统任务繁重或一个实例对象难以胜任时,就显得捉襟见肘,多例模式作为单例模式的扩展,通过生成有限个实例对象,既能避免类体本身实例对象的无序生成,又很好的解决了单个实例对象所不能完成的任务,可以说是单例模式优点的延续和扩展.
中文关键词: 模式  单例  多例  变量
Abstract:The singleton pattern is a design pattern used for Web development,the class instantiate the only object inside the class applied the singleton pattern, and provide the object to the whole application through the static methods of the class, play a shared global role. Application of this kind of mode can reduce the application's resource consumption and improve operational efficiency. But it is difficult when competency system task or an instance exists only. Multiple instances model is as an extension of singleton pattern. It can avoid disorderly generating the class body object through generating a finite object instance.It is a very good solution to finish the task unfinished by the only object also. This model can be said to be continuation and expansion of the singleton pattern.
文章编号:     中图分类号:    文献标志码:
基金项目:
引用文本:
刘耀钦.单例模式及其扩展在Web开发中的应用分析.计算机系统应用,2014,23(5):218-221
LIU Yao-Qin.Application Analysis of Singleton Pattern and its Extension in Web Development.COMPUTER SYSTEMS APPLICATIONS,2014,23(5):218-221