19/03/2009
要想让平台的适应面扩大,就要让平台从封闭走向开放——使其能够在各个层次和已获得广泛应用的各类软件进行互联。可以互联的层次有:
逻辑(物理)建模、流程组态、访问控制、界面组态、界面交互、数据读写、消息机制……
千里之行,始于足下——先从建模开始吧。我发现业界关于元模型信息交换有一个标准(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>