Yi's profile无尽愿PhotosBlogListsMore Tools Help
    3/19/2009

    基于XMI标准的知识交换

        要想让平台的适应面扩大,就要让平台从封闭走向开放——使其能够在各个层次和已获得广泛应用的各类软件进行互联。可以互联的层次有:

    逻辑(物理)建模、流程组态、访问控制、界面组态、界面交互、数据读写、消息机制……

        千里之行,始于足下——先从建模开始吧。我发现业界关于元模型信息交换有一个标准(XMI),于是花了大几天的功夫,总算找到了一个可以同时被多个工具正确识别的XMI格式样板:

    <?xml version = '1.0' encoding = 'GBK' ?>
    <XMI xmi.version = '1.2' xmlns:UML = '//org.omg/UML/1.3'>
     <XMI.header>
      <XMI.documentation>
       <XMI.exporter>
         Together
       </XMI.exporter>
       <XMI.exporterVersion>
         6.1
       </XMI.exporterVersion>
      </XMI.documentation>
      <XMI.metamodel xmi.name = 'UML' xmi.version = '1.4'/>
     </XMI.header>
     <XMI.content>
      <UML:Model xmi.id = 'S.1' name = 'Project' visibility = 'public'>
       <UML:Namespace.ownedElement>
        <UML:Package xmi.id = 'S.3'
              name = 'MyPkg' visibility = 'package' isSpecification = 'false'
              isAbstract = 'false'>
         <UML:Namespace.ownedElement>
          <UML:Class xmi.id = 'S.6'
                name = '车' visibility = 'package' isSpecification = 'false'
                isAbstract = 'false' isActive = 'false'>
           <UML:Classifier.feature>
            <UML:Attribute xmi.id = 'S.7'
                  name = '排量' visibility = 'private' isSpecification = 'false'
                  changeability = 'changeable' ownerScope = 'instance'>
             <UML:StructuralFeature.multiplicity>
              <UML:Multiplicity>
               <UML:Multiplicity.range>
                <UML:MultiplicityRange lower = '1' upper = '1'/>
               </UML:Multiplicity.range>
              </UML:Multiplicity>
             </UML:StructuralFeature.multiplicity>
             <UML:StructuralFeature.type>
              <UML:Classifier>
               <UML:Namespace.ownedElement>
                <UML:DataType xmi.idref = 'G.1'/>
               </UML:Namespace.ownedElement>
              </UML:Classifier>
             </UML:StructuralFeature.type>
            </UML:Attribute>
            <UML:Operation xmi.id = 'S.8'
                  name = '启动' visibility = 'package'
                  isSpecification = 'false'
                  isAbstract = 'false' ownerScope = 'instance'>
             <UML:BehavioralFeature.parameter>
             </UML:BehavioralFeature.parameter>
            </UML:Operation>
            <UML:Operation xmi.id = 'S.9'
                  name = '前进' visibility = 'package'
                  isSpecification = 'false'
                  isAbstract = 'false' ownerScope = 'instance'>
             <UML:BehavioralFeature.parameter>
             </UML:BehavioralFeature.parameter>
            </UML:Operation>
            <UML:Operation xmi.id = 'S.10'
                  name = '转向' visibility = 'package'
                  isSpecification = 'false'
                  isAbstract = 'false' ownerScope = 'instance'>
             <UML:BehavioralFeature.parameter>
              <UML:Parameter xmi.id = 'XX.0' name = 'Angle' isSpecification = 'false' kind = 'inout' type = 'G.1'>
              </UML:Parameter>
             </UML:BehavioralFeature.parameter>
            </UML:Operation>
           </UML:Classifier.feature>
           <UML:Namespace.ownedElement>
            <UML:Generalization xmi.id = 'G.2'
                  name = '' visibility = 'public' isSpecification = 'false'
                  discriminator = ''>
             <UML:Generalization.child>
              <UML:GeneralizableElement xmi.idref = 'S.6'/>
             </UML:Generalization.child>
             <UML:Generalization.parent>
              <UML:GeneralizableElement xmi.idref = 'S.11'/>
             </UML:Generalization.parent>
            </UML:Generalization>
           </UML:Namespace.ownedElement>
          </UML:Class>
          <UML:Class xmi.id = 'S.12'
                name = '厂家' visibility = 'package' isSpecification = 'false'
                isAbstract = 'false' isActive = 'false'>
           <UML:Classifier.feature>
            <UML:Attribute xmi.id = 'S.13'
                  name = '名称' visibility = 'public' isSpecification = 'false'
                  changeability = 'changeable' ownerScope = 'instance'>
             <UML:StructuralFeature.multiplicity>
              <UML:Multiplicity>
               <UML:Multiplicity.range>
                <UML:MultiplicityRange lower = '1' upper = '1'/>
               </UML:Multiplicity.range>
              </UML:Multiplicity>
             </UML:StructuralFeature.multiplicity>
             <UML:StructuralFeature.type>
              <UML:Classifier>
               <UML:Namespace.ownedElement>
                <UML:DataType xmi.idref = 'G.3'/>
               </UML:Namespace.ownedElement>
              </UML:Classifier>
             </UML:StructuralFeature.type>
            </UML:Attribute>
            <UML:Attribute xmi.id = 'S.14'
                  name = '地址' visibility = 'private' isSpecification = 'false'
                  changeability = 'changeable' ownerScope = 'instance'>
             <UML:StructuralFeature.multiplicity>
              <UML:Multiplicity>
               <UML:Multiplicity.range>
                <UML:MultiplicityRange lower = '1' upper = '1'/>
               </UML:Multiplicity.range>
              </UML:Multiplicity>
             </UML:StructuralFeature.multiplicity>
             <UML:StructuralFeature.type>
              <UML:Classifier>
               <UML:Namespace.ownedElement>
                <UML:DataType xmi.idref = 'G.3'/>
               </UML:Namespace.ownedElement>
              </UML:Classifier>
             </UML:StructuralFeature.type>
            </UML:Attribute>
            <UML:Attribute xmi.id = 'S.15'
                  name = '联系方式' visibility = 'private' isSpecification = 'false'
                  changeability = 'changeable' ownerScope = 'instance'>
             <UML:StructuralFeature.multiplicity>
              <UML:Multiplicity>
               <UML:Multiplicity.range>
                <UML:MultiplicityRange lower = '1' upper = '1'/>
               </UML:Multiplicity.range>
              </UML:Multiplicity>
             </UML:StructuralFeature.multiplicity>
             <UML:StructuralFeature.type>
              <UML:Classifier>
               <UML:Namespace.ownedElement>
                <UML:DataType xmi.idref = 'G.3'/>
               </UML:Namespace.ownedElement>
              </UML:Classifier>
             </UML:StructuralFeature.type>
            </UML:Attribute>
            <UML:Attribute xmi.id = 'S.16'
                  name = 'ID' visibility = 'private' isSpecification = 'false'
                  changeability = 'changeable' ownerScope = 'instance'>
             <UML:StructuralFeature.multiplicity>
              <UML:Multiplicity>
               <UML:Multiplicity.range>
                <UML:MultiplicityRange lower = '1' upper = '1'/>
               </UML:Multiplicity.range>
              </UML:Multiplicity>
             </UML:StructuralFeature.multiplicity>
             <UML:StructuralFeature.type>
              <UML:Classifier>
               <UML:Namespace.ownedElement>
                <UML:DataType xmi.idref = 'G.4'/>
               </UML:Namespace.ownedElement>
              </UML:Classifier>
             </UML:StructuralFeature.type>
            </UML:Attribute>
           </UML:Classifier.feature>
          </UML:Class>
          <UML:Class xmi.id = 'S.11'
                name = '产品' visibility = 'package' isSpecification = 'false'
                isAbstract = 'false' isActive = 'false'>
           <UML:Classifier.feature>
            <UML:Attribute xmi.id = 'S.17'
                  name = '生产厂家' visibility = 'public' isSpecification = 'false'
                  changeability = 'changeable' ownerScope = 'instance'>
             <UML:StructuralFeature.multiplicity>
              <UML:Multiplicity>
               <UML:Multiplicity.range>
                <UML:MultiplicityRange lower = '1' upper = '1'/>
               </UML:Multiplicity.range>
              </UML:Multiplicity>
             </UML:StructuralFeature.multiplicity>
             <UML:StructuralFeature.type>
              <UML:Classifier>
               <UML:Namespace.ownedElement>
                <UML:DataType xmi.idref = 'G.4'/>
               </UML:Namespace.ownedElement>
              </UML:Classifier>
             </UML:StructuralFeature.type>
            </UML:Attribute>
            <UML:Attribute xmi.id = 'S.18'
                  name = '型号' visibility = 'public' isSpecification = 'false'
                  changeability = 'changeable' ownerScope = 'instance'>
             <UML:StructuralFeature.multiplicity>
              <UML:Multiplicity>
               <UML:Multiplicity.range>
                <UML:MultiplicityRange lower = '1' upper = '1'/>
               </UML:Multiplicity.range>
              </UML:Multiplicity>
             </UML:StructuralFeature.multiplicity>
             <UML:StructuralFeature.type>
              <UML:Classifier>
               <UML:Namespace.ownedElement>
                <UML:DataType xmi.idref = 'G.3'/>
               </UML:Namespace.ownedElement>
              </UML:Classifier>
             </UML:StructuralFeature.type>
            </UML:Attribute>
            <UML:Attribute xmi.id = 'S.19'
                  name = '生产日期' visibility = 'private' isSpecification = 'false'
                  changeability = 'changeable' ownerScope = 'instance'>
             <UML:StructuralFeature.multiplicity>
              <UML:Multiplicity>
               <UML:Multiplicity.range>
                <UML:MultiplicityRange lower = '1' upper = '1'/>
               </UML:Multiplicity.range>
              </UML:Multiplicity>
             </UML:StructuralFeature.multiplicity>
             <UML:StructuralFeature.type>
              <UML:Classifier>
               <UML:Namespace.ownedElement>
                <UML:DataType xmi.idref = 'G.5'/>
               </UML:Namespace.ownedElement>
              </UML:Classifier>
             </UML:StructuralFeature.type>
            </UML:Attribute>
            <UML:Attribute xmi.id = 'S.20'
                  name = '保修期' visibility = 'private' isSpecification = 'false'
                  changeability = 'changeable' ownerScope = 'instance'>
             <UML:StructuralFeature.multiplicity>
              <UML:Multiplicity>
               <UML:Multiplicity.range>
                <UML:MultiplicityRange lower = '1' upper = '1'/>
               </UML:Multiplicity.range>
              </UML:Multiplicity>
             </UML:StructuralFeature.multiplicity>
             <UML:StructuralFeature.type>
              <UML:Classifier>
               <UML:Namespace.ownedElement>
                <UML:DataType xmi.idref = 'G.6'/>
               </UML:Namespace.ownedElement>
              </UML:Classifier>
             </UML:StructuralFeature.type>
            </UML:Attribute>
            <UML:Operation xmi.id = 'S.21'
                  name = '销售' visibility = 'package'
                  isSpecification = 'false'
                  isAbstract = 'false' ownerScope = 'instance'>
             <UML:BehavioralFeature.parameter>
             </UML:BehavioralFeature.parameter>
            </UML:Operation>
            <UML:Operation xmi.id = 'S.22'
                  name = '购买' visibility = 'package'
                  isSpecification = 'false'
                  isAbstract = 'false' ownerScope = 'instance'>
             <UML:BehavioralFeature.parameter>
             </UML:BehavioralFeature.parameter>
            </UML:Operation>
            <UML:Operation xmi.id = 'S.23'
                  name = '使用' visibility = 'package'
                  isSpecification = 'false'
                  isAbstract = 'false' ownerScope = 'instance'>
             <UML:BehavioralFeature.parameter>
             </UML:BehavioralFeature.parameter>
            </UML:Operation>
            <UML:Operation xmi.id = 'S.24'
                  name = '维修' visibility = 'package'
                  isSpecification = 'false'
                  isAbstract = 'false' ownerScope = 'instance'>
             <UML:BehavioralFeature.parameter>
             </UML:BehavioralFeature.parameter>
            </UML:Operation>
            <UML:Operation xmi.id = 'S.25'
                  name = '报废' visibility = 'package'
                  isSpecification = 'false'
                  isAbstract = 'false' ownerScope = 'instance'>
             <UML:BehavioralFeature.parameter>
             </UML:BehavioralFeature.parameter>
            </UML:Operation>
           </UML:Classifier.feature>
          </UML:Class>
         </UML:Namespace.ownedElement>
        </UML:Package>
        <UML:DataType xmi.id = 'G.1'
              name = 'Real' visibility = 'public' isSpecification = 'false'/>
        <UML:DataType xmi.id = 'G.3'
              name = 'String' visibility = 'public' isSpecification = 'false'/>
        <UML:DataType xmi.id = 'G.4'
              name = 'Integer' visibility = 'public' isSpecification = 'false'/>
        <UML:DataType xmi.id = 'G.5'
              name = 'Date' visibility = 'public' isSpecification = 'false'/>
        <UML:DataType xmi.id = 'G.6'
              name = 'Double' visibility = 'public' isSpecification = 'false'/>
       </UML:Namespace.ownedElement>
      </UML:Model>
     </XMI.content>
    </XMI>

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://creationzy.spaces.live.com/blog/cns!F7BAA280447BB7D7!627.trak
    Weblogs that reference this entry
    • None