应用装饰模式创建CSS  

Creation of CSS with the Use of Decorator Pattern

在线阅读下载全文

作  者:肖永刚[1] 

机构地区:[1]文山学院计算机科学系,云南文山663000

出  处:《兰州工业高等专科学校学报》2012年第6期20-23,共4页Journal of Lanzhou Higher Polytechnical College

摘  要:介绍了应用装饰模式自动生成CSS的方法.原始的设计是基于继承的,子类功能的增加是通过覆盖或扩展父类方法实现的.优化的设计应用了装饰模式,获得了良好的可扩展性和可维护性.将CSS细分成不同的部分,每个部分作为一个装饰类.可以根据需要灵活地使用这些装饰类生成不同风格的CSS.通过对比这两种设计方式,最后列出了利用装饰模式的优缺点.This paper introduces the application of Decorator Pattern in the field of creating CSS automatically. The original design is based on inheritance and the additional functionality of subclasses is implemented by over- riding or extending methods in the superclass. The optimized design that applies Decorator Pattern accommodates the future extension and maintenance. It divides a CSS file into several parts, each of which develops into a dec- orator. These decorators can be flexibly used to create CSS of different style. The processes of both designs are explained in detail. By contrasting both designs, the advantages and disadvantages of the pattern are listed.

关 键 词:装饰模式 继承 应用 CSS 

分 类 号:TP31[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象