[Xml-logilab] inheritance/generalisation parent is None?

abulka@netspace.net.au abulka@netspace.net.au
Fri, 20 Sep 2002 19:21:06 +1000 (EST)


In the .xmi generated by release 0.3.1 using python 2.2, I don't seem to be 
getting inheritance relationships properly specified.

When viewed in argo, yhe parent of a generalisation is always None, instead of 
the actual parent class.  I even ran the example in the readme
         cd ~/lib/python21/site-packages/
	 pyargo -p PyReverse logilab/pyreverse 

and examined the classes in poseidon/argo and also "enterprise architect" and 
sure enough the generalisations are generated, but without parents.

I even tried pyargo on the simplest case

class A:
    pass
class B(A):
    pass

and got the same problem!  E.g. the xmi I got was as follows - is this what 
everyone else gets? (sorry about the length, but its the simplest possible 
case):

THE COMMAND I ISSUED:

>\python22\Lib\site-packages\logilab\pyreverse\pyargo.py -p 
simpleclasses01 "simpleclasses01.py"

WHAT I GOT:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE XMI SYSTEM "uml13.dtd">
<XMI xmi.version='1.0'>
  <XMI.header>
    <XMI.documentation>
      <XMI.exporter>PyReverse</XMI.exporter>
      <XMI.exporterVersion>0.3.1</XMI.exporterVersion>
    </XMI.documentation>
    <XMI.metamodel xmi.version='1.3' xmi.name='UML'/>
  </XMI.header>
  <XMI.content>
    <Model_Management.Model xmi.uuid='127-0-0-1-unbelid:entifiant:-7fff' 
xmi.id='xmi-1'>
      
<Foundation.Core.ModelElement.name>simpleclasses01</Foundation.Core.ModelElement
.name>
      <Foundation.Core.ModelElement.isSpecification xmi.value='false'/>
      <Foundation.Core.GeneralizableElement.isRoot xmi.value='false'/>
      <Foundation.Core.GeneralizableElement.isLeaf xmi.value='false'/>
      <Foundation.Core.GeneralizableElement.isAbstract xmi.value='false'/>
      <Foundation.Core.Namespace.ownedElement>
        <Model_Management.Package xmi.uuid='127-0-0-1-unbelid:entifiant:-7ffe' 
xmi.id='xmi-2'>
          
<Foundation.Core.ModelElement.name>simpleclasses01</Foundation.Core.ModelElement
.name>
          <Foundation.Core.ModelElement.visibility xmi.value='public'/>
          <Foundation.Core.ModelElement.isSpecification xmi.value='false'/>
          <Foundation.Core.GeneralizableElement.isRoot xmi.value='false'/>
          <Foundation.Core.GeneralizableElement.isLeaf xmi.value='false'/>
          <Foundation.Core.GeneralizableElement.isAbstract xmi.value='false'/>
          <Foundation.Core.Namespace.ownedElement>
            <Foundation.Core.Class xmi.uuid='127-0-0-1-unbelid:entifiant:-7ffd' 
xmi.id='xmi-3'>
              
<Foundation.Core.ModelElement.name>A</Foundation.Core.ModelElement.name>
              <Foundation.Core.ModelElement.visibility xmi.value='public'/>
              <Foundation.Core.ModelElement.isSpecification xmi.value='false'/>
              <Foundation.Core.GeneralizableElement.isRoot xmi.value='false'/>
              <Foundation.Core.GeneralizableElement.isLeaf xmi.value='true'/>
              <Foundation.Core.GeneralizableElement.isAbstract 
xmi.value='false'/>
              <Foundation.Core.Class.isActive xmi.value='false'/>
            </Foundation.Core.Class>
            <Foundation.Core.Class xmi.uuid='127-0-0-1-unbelid:entifiant:-7ffc' 
xmi.id='xmi-4'>
              
<Foundation.Core.ModelElement.name>B</Foundation.Core.ModelElement.name>
              <Foundation.Core.ModelElement.visibility xmi.value='public'/>
              <Foundation.Core.ModelElement.isSpecification xmi.value='false'/>
              <Foundation.Core.GeneralizableElement.isRoot xmi.value='false'/>
              <Foundation.Core.GeneralizableElement.isLeaf xmi.value='true'/>
              <Foundation.Core.GeneralizableElement.isAbstract 
xmi.value='false'/>
              <Foundation.Core.Class.isActive xmi.value='false'/>
              <Foundation.Core.GeneralizableElement.generalization>
                <Foundation.Core.Generalization xmi.idref='xmi-5'/>
              </Foundation.Core.GeneralizableElement.generalization>
            </Foundation.Core.Class>
            <Foundation.Core.Generalization xmi.uuid='127-0-0-1-
unbelid:entifiant:-7ffb' xmi.id='xmi-5'>
              <Foundation.Core.ModelElement.isSpecification xmi.value='false'/>
              <Foundation.Core.Generalization.child>
                <Foundation.Core.Class xmi.idref='xmi-4'/>
              </Foundation.Core.Generalization.child>
            </Foundation.Core.Generalization>
          </Foundation.Core.Namespace.ownedElement>
        </Model_Management.Package>
      </Foundation.Core.Namespace.ownedElement>
    </Model_Management.Model>
  </XMI.content>
</XMI>

------------------
-Andy Bulka
http://www.atug.com/andypatterns






------------------------------------------------------------
This email sent from Netspace Webemail: www.netspace.net.au