Book a Demo

Author Topic: Port is a child element ?  (Read 3083 times)

Viking

  • EA User
  • **
  • Posts: 465
  • Karma: +2/-2
    • View Profile
Port is a child element ?
« 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.

Viking

  • EA User
  • **
  • Posts: 465
  • Karma: +2/-2
    • View Profile
Re: Port is a child element ?
« Reply #1 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?

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Port is a child element ?
« Reply #2 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
My theories are always correct, just apply them to the right reality.

Viking

  • EA User
  • **
  • Posts: 465
  • Karma: +2/-2
    • View Profile
Re: Port is a child element ?
« Reply #3 on: June 12, 2020, 12:42:13 am »
@Uffe, great explanation. Thank you.