Menu

Interface objects creation

Help
fabraz
2008-07-22
2013-04-29
  • fabraz

    fabraz - 2008-07-22

    Hi there,

    Does anyone has faced the situation of trying to dynamically create an interface object such as "Namespace" and got problem?

    I realized that some interfaces has no corresponding method that allows the creation of their instances. Is that correct?

    Since the deserialization doesn't for Poseidon XMI files, I'm trying to create the corresponding UML model using nUML.

    Here is a fragment of Poseidon XMI file. I supposed I had to create an instance of Namespace interface to do that, as was as a BehavioredClassifier. Both of them have no creation method on Create class.

    Any recommendation?

    Thanks',

    Fabricio

     
    • fabraz

      fabraz - 2008-07-22

      The missed fragment:

       
    • fabraz

      fabraz - 2008-07-22

      - <XMI.content>
      - <UML:Model xmi.id="Im41078eddm11b18c1bc61mm7e0d" name="Financing" isSpecification="false" isRoot="false" isLeaf="false" isAbstract="false">
      - <UML:Namespace.ownedElement>
      - <UML:Collaboration xmi.id="Im41078eddm11b18c1bc61mm7e03" name="Colaboração_1" visibility="public" isSpecification="false" isRoot="false" isLeaf="false" isAbstract="false">
      - <UML2:BehavioredClassifier.ownedBehavior>
      - <UML2:Activity xmi.id="Im41078eddm11b18c1bc61mm7e02" name="Colaboração_1.Activity_1" visibility="public" isSpecification="false" isRoot="false" isLeaf="false" isAbstract="false" isActive="false" isReadOnly="false" isSingleExecution="false">
      - <UML2:Activity.edge>
      + <UML2:ActivityEdge xmi.id="Im41078eddm11b18c1bc61mm7db4" visibility="public" isSpecification="false">
      + <UML2:ActivityEdge.target>
        <UML2:CallAction xmi.idref="Im41078eddm11b18c1bc61mm7dbb" />
        </UML2:ActivityEdge.target>
      - <UML2:ActivityEdge.source>
        <UML2:InitialNode xmi.idref="Im41078eddm11b18c1bc61mm7dcd" />
        </UML2:ActivityEdge.source>
      - <UML2:ActivityEdge.inGroup>
        <UML2:ActivityPartition xmi.idref="Im41078eddm11b18c1bc61mm7df6" />
        </UML2:ActivityEdge.inGroup>
        </UML2:ActivityEdge>
      + <UML2:ActivityEdge xmi.id="Im41078eddm11b18c1bc61mm7cee" visibility="public" isSpecification="false">
      - <UML2:ActivityEdge.target>
        <UML2:Pin xmi.idref="Im41078eddm11b18c1bc61mm7d91" />
        </UML2:ActivityEdge.target>
      - <UML2:ActivityEdge.source>
        <UML2:CallAction xmi.idref="Im41078eddm11b18c1bc61mm7dbb" />
        </UML2:ActivityEdge.source>
      - <UML2:ActivityEdge.inGroup>
        <UML2:ActivityPartition xmi.idref="Im41078eddm11b18c1bc61mm7df6" />
        </UML2:ActivityEdge.inGroup>
        </UML2:ActivityEdge>
      - <UML2:ActivityEdge xmi.id="Im41078eddm11b18c1bc61mm7c48" visibility="public" isSpecification="false">

       
    • Rodolfo Campero

      Rodolfo Campero - 2008-07-23

      >Does anyone has faced the situation of trying to dynamically
      >create an interface object such as "Namespace" and got problem?
      >
      >I realized that some interfaces has no corresponding method that
      >allows the creation of their instances. Is that correct?

      Yes, that's because "Namespace" is an abstract metaclass, meaning it has no instances of its own. Think of it as the example classes "Animal" and "Dog": you can find several instances of "Dog", which are all dogs and animals at the same time, but it's impossible to find a pure "animal" that is not an instance of a more concrete concept. In this case, "Animal" is an abstract class and "Dog" is a concrete class.

      Back to the "Namespace" problem: I think the class you're looking for is "Package".

      >Since the deserialization doesn't for Poseidon XMI files, I'm
      >trying to create the corresponding UML model using nUML.
      >
      >Here is a fragment of Poseidon XMI file. I supposed I had to
      >create an instance of Namespace interface to do that, as was
      >as a BehavioredClassifier. Both of them have no creation method
      >on Create class.
      >
      >Any recommendation?

      Please file a bug report with a sample file generated with Poseidon for UML. The whole zargo file will do. The sample you pasted in another message looks weird because it uses two different prefixes (UML and UML2); maybe you tweaked it by hand?

      At present time Activity models are not fully supported in nUML (AFAIR) nor the XSLT file for importing from Poseidon, so please include in your bug report all the features you would like to see implemented.

      In the meantime, look for concrete classes deriving from the ones you need (Namespace and BehavioredClassifier), and use the corresponding methods in the Create class to instanciate them.

      Hope this helps,

      Rodolfo

       
      • fabraz

        fabraz - 2008-07-27

        Rodolfo,

        I've used BehavioredClassifier and it works.

        I have not changed the Xmi file. It's exactly how Poseidon created that.

        I will file a bug report as you recommended.

        Thanks,

        Fabricio

         

Log in to post a comment.

MongoDB Logo MongoDB