Manage Inherited and Redefined Ports

Return to Introduction  Previous page  Next page

A Port is a redefinable and re-useable property of a composite classifier. So, as for attributes, any Class can inherit Ports from its parent and realized interfaces. If you have an inheritance hierarchy with Ports defined in the parent Classes, when you open the Embedded Elements dialog the inherited Ports and their named owners are listed there.

It is possible to expose, for design purposes, an inherited Port (ie. the child Class is re-using the parent Port). In this case, Enterprise Architect creates a clone of the re-used Port and marks it as read-only in the child Class. This is convenient for modeling Port interactions in child Classes where the Ports are defined in the parent elements. 

It is also possible to redefine a Port in a child Class, so that the name is the same but the child is a modifiable clone of the original. This is useful where a child Class places additional restrictions or behavior on the Port. The Embedded Elements dialog enables you to highlight an inherited Port and mark it as redefined; this creates a new Port on the child Class, which is editable but still logically related to the initial Port.

The Embedded Elements dialog below illustrates Port inheritance. The Port removableHD is owned by the child Class. The Ports eth0 and USB are owned by the Computer Class. The Port firewire has been added to PC. If any of the inherited Ports are made visible, they are considered re-use Ports and appear on the child in read-only format. By using the Redefine button, the inherited Port can be copied down and made writeable.


See Also