首页 | 本学科首页   官方微博 | 高级检索  
     

应用装饰模式创建CSS
引用本文:肖永刚.应用装饰模式创建CSS[J].兰州工业高等专科学校学报,2012(6):20-23.
作者姓名:肖永刚
作者单位:文山学院计算机科学系,云南文山663000
摘    要:介绍了应用装饰模式自动生成CSS的方法.原始的设计是基于继承的,子类功能的增加是通过覆盖或扩展父类方法实现的.优化的设计应用了装饰模式,获得了良好的可扩展性和可维护性.将CSS细分成不同的部分,每个部分作为一个装饰类.可以根据需要灵活地使用这些装饰类生成不同风格的CSS.通过对比这两种设计方式,最后列出了利用装饰模式的优缺点.

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

Creation of CSS with the Use of Decorator Pattern
XIAO Yong-gang.Creation of CSS with the Use of Decorator Pattern[J].Journal of Lanzhou Higher Polytechnical College,2012(6):20-23.
Authors:XIAO Yong-gang
Affiliation:XIAO Yong-gang ( Department of Computer Science, Wenshan University, Yunnan Wenshan 663000, China)
Abstract: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.
Keywords:Decorator Pattern  inheritance  application  CSS
本文献已被 CNKI 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号