Book a Demo

Author Topic: How do you draw a "proper" composite structure diagram?  (Read 3694 times)

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
How do you draw a "proper" composite structure diagram?
« on: July 15, 2020, 05:41:28 pm »
After having trouble in the other topic "No connectors shown after XMI import", I am wondering if it is my modeling technique that is the problem. Here is how I draw a composite structure diagram:

  • Create a class myStructuredClass
  • Create a class myFirstClass with one port
  • Create a class mySecondClass with one port
  • Insert a composite structure diagram below that class
  • Drag and drop a myFirstClass as a property onto the diagram
  • Drag and drop a mySecondClass as a property onto the diagram
  • Connect the ports in the diagram.

This constitutes a proper composite structure diagram, is this correct? I have my doubts because if you export that example to XMI and import it again, you will not see the connection. The connection is in the model, but not where you might expect. You will find the connection information on the type (the class) of the parts. It's almost as if the original connector was superfluous. Also, when you do this, you will end up with duplicate ports as well. It gets very confusing.
« Last Edit: July 15, 2020, 05:43:39 pm by mse »

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: How do you draw a "proper" composite structure diagram?
« Reply #1 on: July 15, 2020, 06:01:58 pm »
It sounds about right just a number of random comments:
1) you only need ports if there are interactions - e.g., in the Computer example at the end of the page linked below, https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-composite-structure-diagram/
2) you want your structured diagram under the composite class, in your example myStructuredClass
3) I will try an example without ports, something like the car or order example in the link above, and see what happens with XMI import


What version of Sparx are you using?

Any chance you can post a screenshot of how things look after and before the XMI export/import, including diagrams and the strcture of your project?

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: How do you draw a "proper" composite structure diagram?
« Reply #2 on: July 15, 2020, 06:15:52 pm »
I am using version 14.

Regarding screenshots, I have to find a way to upload images. However, in the PC example you provided, it looks like that diagram, only, it consists of two parts similiar to the PSU and MB with a simple connection between the ports.

The composite structure diagram is below the class, and in order to verify it, I can simply click on the class itself and enable visibility for the  Parts/Properties of that class and they automatically show up on the diagram.

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: How do you draw a "proper" composite structure diagram?
« Reply #3 on: July 15, 2020, 06:32:03 pm »
Î got some interesting results while trying what you were going to try with the connector between parts instead of ports. The connectors shows up whether you drag and drop the parts onto the diagram as a link or enable it via the Features/Attributes tab of the composite class.

However, the connections between ports only show up if you drag and drop the parts as link and NOT when you enable it via the Feature/Attributes tab. Strangely, I also get a second set of ports for the parts. So instead of this:

property: Class3
p1
p2

I get the following:

property: Class3
p1
p1
p2
p2