针对面向方面这种新型的编程方法进行分析,并对面向对象理论在解决XML文档定义时不足之处加以阐述,提出利用面向方面的编程方法对XML文档定义进行扩展,解决XML文档定义仅采用简单包含关系、代码重复、横切关注点的分散及扩充XML元素时必须对原有元素修改的问题.在XML文档定义中引入关注点这一概念和织入重要机制,使XML文档定义具有面向方面编程技术的功能.在XML Schema原有定义方式中增加aspect,pointcut和advice几个定义元素的标识元素.给出相应的表示符号,并用数学模型描述.结果表明这种定义方式减少系统中的代码重复,降低模块间的耦合,使之具有较好的模块性和可移植性.
Analyzes the newly developed aspect-oriented programming approach and the disadvantages of object-oriented theory in defining XML document.Defining the XML document by aspect-oriented programming to extend it is proposed to solve the problems found in original definition,such as too simple relationship of inclusion,code redundancy,scattered crosscut concerns and having to modify original elements if extending XML elements.Introducing the concept of crosscut concerns and weaving them statically/dynamically i...