embedding components within components in diagram

1,226 views
Skip to first unread message

rgupta4

unread,
Aug 8, 2012, 10:21:00 PM8/8/12
to sparx-enterprise-archite...@googlegroups.com
I apologize in advance for this newbie question, but how does one go about embedding a UML component within another UML component in a diagram?

[original message]

RoyC

unread,
Aug 9, 2012, 12:14:00 AM8/9/12
to sparx-enterprise-archite...@googlegroups.com
I'm not sure how specific you are being with the terms 'component' and 'embedded element', but you might look up Embedded Element in the Index of the EA Help integrated with your installation of EA.

Alternatively, you could look up Composite elements; is that what you mean by embedding a UML component within a UML component? If it's a mix of both, you can show truely embedded elements on a composite element.

[original message]

rgupta4

unread,
Aug 9, 2012, 12:32:00 AM8/9/12
to sparx-enterprise-archite...@googlegroups.com
Thank you. I'm referring specifically to a UML component. I'd like to create a component diagram that consists of components containing other components. I will look up composite elements.
[original message]

Bellekens@localhost Geert Bellekens

unread,
Aug 9, 2012, 1:23:00 AM8/9/12
to sparx-enterprise-archite...@googlegroups.com
The most basic explanation:
If you have two UML components C_owner and C_owned then you should make sure that C_owner actually contains C_owned in the projectbrowser.
So it should look like

Code:
C_owner
|__C_owned

Then you put both components on your diagram, make C_owner larger, and drag C_owned onto C_owner.

Geert

[original message]

RoyC

unread,
Aug 9, 2012, 1:54:00 AM8/9/12
to sparx-enterprise-archite...@googlegroups.com
Dragging C_Owned inside C_Owner on the diagram automatically makes C_Owned a child of C_Owner in the Project Browser.

As Geert says, that mechanism is a simple and basic solution. If you want to have any kind of element structure underneath C_Owner, though, it is easier to make C_Owner a composite and represent the complexity on a child Composite diagram. If you can't already (optionally) display the Composite diagram within the element border - and I'm pretty sure you can (but I can't check at the moment), you will be able to in the near future.

[original message]

rgupta4

unread,
Aug 14, 2012, 8:06:00 AM8/14/12
to sparx-enterprise-archite...@googlegroups.com
Thanks for the feedback and suggestions. Given that I am somewhat new to the tool I am not sure if I am doing things correctly.

1. I created a component and dragged to a diagram made it a composite element. (P)

2. I created several components as children in the object browser.

3. I dragged those components onto the diagram and placed them in P.

These components appear to be embedded in (P), but when I used the layout diagram function, the child components were drawn outside of (P). If the child components are placed inside (P), when I move (P) around, the child components move with it.. Anyways, I hope I am doing this right.

[original message]

RoyC

unread,
Aug 14, 2012, 8:55:00 AM8/14/12
to sparx-enterprise-archite...@googlegroups.com
You have gone wrong at step 3. �

With Component P on your diagram, right-click on P and select the context menu option Advanced | Make Composite. This puts a 'chain link' icon on the element and adds a child diagram. Double-click on P to display the child diagram, and add your child elements to that diagram, in whatever structure or layout you require.

Element P can simply show the 'chain-link' icon to indicate that if you double-click on it you will open a diagram of subcomponents. OR, right-click on P and select the Advanced | Show Composite Diagram menu option. This displays P as a frame containing the contents of the child diagram. �

This is all documented here:

http://www.sparxsystems.com/enterprise_architect_user_guide/9.3/modeling_basics/compositeelements.html

[original message]

rgupta4

unread,
Aug 13, 2012, 11:05:00 PM8/13/12
to sparx-enterprise-archite...@googlegroups.com
Thanks. This worked like a charm.
[original message]
Reply all
Reply to author
Forward
0 new messages