Model introduction

1.Model are also called as thing

    Model in X-Meta engine is also known as thing, so model is thing and thing is model.

2.Structure of the model

    Model's structure and XML's structure is the same, is made up of attributes and child nodes.

    Pictured above, a model is composed of attributes, child model (also known as a child or child nodes) andbehavior (behavior is child node) form.

  • Things and nodes
    X-Meta engine, any XML node is resolved a separate thing (Thing), so that every node is one thing.
     
  • Attribute
    A node can contain any number of attributes, the property is made up of key and value key-value pairs.
     
  • Behavior
    Behavior can be executed, Things that define under the actions node are behaviros. Person defined whoAmI and sayHello two acts.                                                                                    

3.Descriptor

    We define a name = "Person" object model, it can be described following this model.

    Pictured above, Person is the descriptor of the model which name is "Zhangsan".

  • Person descripted the strucutre of Zhangsan
    Person is the descriptor of Zhangsan. We can use Peron to explan Zhangsan, for example person has <attribute name="name"/> and <attribute name="age"/> two child, then we can say Zhangsan has name and age two attribute. Person has <thing name="Child"/> child, then Zhangsan also can has child node named 'Child'.
     
  • Person descripted dehaviors of Zhangsan
    Person has two behavior named whoAmI and sayHello, then Zhangsan has them too.
     
  • Descriptor is class and structure
    To sum up, Descriptor is the class action also play a role in structure.

4.Extend

    Pictured above, ame="Child" child node extended Person's root node, then Child is also a Person.

 

Copyright ©  2007-2019 XWorker.org  版权所有  沪ICP备08000575号