Book a Demo

Author Topic: embedding components within components in diagram  (Read 7046 times)

rgupta4

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
embedding components within components in diagram
« on: August 09, 2012, 12:21:12 pm »
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?

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: embedding components within components in diag
« Reply #1 on: August 09, 2012, 02:14:14 pm »
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.
« Last Edit: August 09, 2012, 02:14:53 pm by RoyC »
Best Regards, Roy

rgupta4

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: embedding components within components in diag
« Reply #2 on: August 09, 2012, 02:32:41 pm »
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.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: embedding components within components in diag
« Reply #3 on: August 09, 2012, 03:23:50 pm »
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: [Select]
C_owner
|__C_owned
Then you put both components on your diagram, make C_owner larger, and drag C_owned onto C_owner.

Geert

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: embedding components within components in diag
« Reply #4 on: August 09, 2012, 03:54:39 pm »
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.
Best Regards, Roy

rgupta4

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: embedding components within components in diag
« Reply #5 on: August 14, 2012, 10:06:03 am »
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.

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: embedding components within components in diag
« Reply #6 on: August 14, 2012, 10:55:17 am »
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
Best Regards, Roy

rgupta4

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: embedding components within components in diag
« Reply #7 on: August 14, 2012, 01:05:45 pm »
Thanks. This worked like a charm.