Sparx Systems Forum

Enterprise Architect => Bugs and Issues => Topic started by: Viking on June 11, 2020, 11:26:52 pm

Title: Port is a child element ?
Post by: Viking on June 11, 2020, 11:26:52 pm
Hi,

In EA it is possible to add a Port to an Element by “New Child Element” > “Port”. I think EA is not consistent here. The documentation says, that a “child element” belongs to “Elements” (Collection) (see Sparx: EA Object Model, p. 109: “Elements: Returns a collection of child elements (sub-elements) attached to this element [...]”, while Port belongs to “Embedded Elements” (Collection). Am I wrong? V.
Title: Re: Port is a child element ?
Post by: Viking on June 11, 2020, 11:53:30 pm
Hi, In EA it is possible to add a Port to an Element by “New Child Element” > “Port”. I think EA is not consistent here. The documentation says, that a “child element” belongs to “Elements” (Collection) (see Sparx: EA Object Model, p. 109: “Elements: Returns a collection of child elements (sub-elements) attached to this element [...]”, while Port belongs to “Embedded Elements” (Collection). Am I wrong? V.

I found out that a Port is part of the EmbeddedElements AND Elements. So the documentation is not wrong. But what is the reason, that Port is member of both collections?
Title: Re: Port is a child element ?
Post by: Uffe on June 12, 2020, 12:11:33 am
They're not separate collections. It's more like an embedded element is a specialization of a child element.

A child element is located hierarchically inside another element (in the browser), and is present in the parent's .Elements.
But .EmbeddedElements contain only those child elements which can only exist as part of the parent, such as Ports.

You can drag one Class into another and out again, but you can't drag a Port out of a Class.


/Uffe
Title: Re: Port is a child element ?
Post by: Viking on June 12, 2020, 12:42:13 am
@Uffe, great explanation. Thank you.