1.使用元事物创建描述者
描述者相当于面向对象中的类,也相当于XML的结构,因此创建描述者就是创建类和结构,而元事物则是创建描述者的事物模型。

2.Person的编辑界面

如上图是Person的编辑界面,这个编辑界面是通过MetaDescriptor3动态生成的。

如上图,MetaDescriptor3定义了事物、动作和属性,通过它们可以在编辑器中编写Person的属性(attribute)、子事物(thing)和行为(action)等子事物,而Person的这些子事物则是具体Person实例的定义。
如果用面向对象来说,比如Person的实例是Tom,那么Person是Tom的类,而MetaDescriptor3是Person的类,所以它们有实例化的顺序,用MetaDescriptor3实例化Person,在用Person实例化Tom。
用XML结构来说,Tom的结构是Person,Person的结构是MetaDescriptor3,所以元事物(MetaDescriptor3)是结构的结构。
<?xml version="1.0" encoding="utf-8"?>
<thing name="Person" descriptors="xworker.lang.MetaDescriptor3">
<description><![CDATA[<h3>元事物的作用</h3>
<p> 元事物用于定义一个事物的属性(attribute)和子事物(thing),
所以可以看到Person有多个名为属性(attribute)和事物(thing)的子节点,而这些子节点就是其实例的属性和子事物的定义。</p>]]></description>
<attribute name="name"></attribute>
<attribute name="label"></attribute>
<attribute name="age"></attribute>
<attribute name="sex" inputtype="select">
<value name="1" label="男" value="1" en_label="Male"></value>
<value name="2" label="女" value="2" en_label="Female"></value>
</attribute>
<attribute name="description" inputtype="html"></attribute>
<thing name="Child" extends="xworker.example.thing.creatething.Person"></thing>
</thing>