Dragging nested components into a diagram in Sparx Enterprise Architect (EA) - components

In my Enterprise Architect model, I have nodes that contain devices that contain components that contain other components. That's how I organized the hierarchy in the Project Browser.
I would like to be able to drag one element of the model into a diagram (as a Link), and be able to see all the elements contained by this element without having to drag them individually. For example, dragging a device into a deployment diagram would display the node and all the components it contains.
This logic works when I drag a component onto a diagram: I am able to select what children elements (interfaces, ports, ...) I want to see on the diagram. But I did not find a way to do the same with this following containment hierarchy: node > device > component > subcomponent.
Is there a way to do so ?
Thank you :)

You can do it manually, of course. Dragging the outermost onto the diagram (as link) and enlarge it. Drag the inner ones onto the diagram somewhere outside the outer one (to avoid some dialog otherwise). Drag them inside the outer and arrange as needed.
Another way is to make the outer element composite (context/Add/Composite diagram or /New Diagram/Composite). On this composite diagram place the inner elements and arrange them. Save the diagram when done. Now you can create diagrams with the outer element which, once enlarged, can show the composite diagram inside. Just drag the composite diagram as Diagram Frame and eventually make it smaller. Then place it inside the enlarged outer component.
While in the first case you can show relations (like port delegation) this is not possible in the second one.
There is no way to automagically drop the nested structure except you come up with some very tricky add-in.

Related

Nested components in Sparx Enterprise Architect (EA)

I am trying to model a software system using Sparx Enterprise Architect 13. In our system, the software components are divided into sub-components (nothing extraordinary).
I know precisely what interfaces the sub-components provide, require and how they are interconnected. So in my model, all the links are defined at sub-component level and not at a component level.
Now, I would be able to produce diagrams representing the big picture, whose elements would be the components and not the sub-components. The idea would be to drag my existing components into a diagram to be able to see the links between them, automatically populated from the links that I have already defined between sub-components.
I found no way to achieve this goal, and I have tried using the following EA element combinations:
components containing other components
packages containing components
packaging components containing components
components containing ports
Is there a way to do that in EA ?
Thank you :)
What I do is to actually use ports on components. An outer component
is set to be composite (note the lying 8 bottom right). When dbl-clicked it will open the composite diagram showing the inner structure like so (the layout must be arranged manually by enlarging the outer and positioning the inner):
Required/provided interfaces can and should be added to the ports as needed. And of course they can be shown and hidden in different diagrams as well.
They key to it all is the composite diagram (context in browser: Add/Composite) which in the end will create a navigable model.
Ports and interfaces can be created via context Structural Elements.
Note: To make an element composite you need to right-click in Project Browser | Add | Composite Structure Diagram. That goes for V13.5 and many other versions (it had been different in the past). And you never know in which place some EA developer will put that functionality in the next version :-/

Sparx EA: What type of relationship created when a Component is added to a Node?

In this question (point #3), I asked about getting a Packaging Component recognized as contained by a Node (device or execution environment) on a deployment diagram.
No direct answer. However, the answers to other points led me toward an alternative that seems simple in concept: manually create the relationship or link.
So, I looked # one of my Component <--> Node "containment" links to see what Sparx creates in the background. But, from the properties page / dialog of both the Component and Node, I can't see anything linking the two.
So ... what is actually created when a Component is "dropped into" a Node?
As I mentioned in my comment to your previous question: None. When you drop one element over another then this is docked graphically (only if it's significantly smaller). As a side effect (and it's legal for UML) the moved element is also made a sub-element of the one where it has been dropped. (There is some option where you can turn of this behavior but don't ask me where in that options haystack EA has.)
P.S.: It's Tools/Options/Diagram/Behavior/Auto Group... (top left the lowest check mark)

Sparx Enterprise Architect diagram with endpoints

I'm trying to structure a big diagram by building smaller diagrams and then connect them in the big picture. The problem i got now is that i can't figure out how to add connectors/endpoint to the diagram frame so that i can follow the arrows between the different diagrams.
Would be grateful for some help figuring this out.
You can't do that. A diagram is not an UML object per se. It's a rendering of a number of elements from the model. So you can not connect anything from inside a diagram frame to the outside.
What I did in similar circumstances was that I placed the element in question aside the frame (probably surrounded by a boundary and some explanatory text) from where I show the connectors going somewhere else in that diagram.
The "diagram frame" element type, which you can create by dragging a diagram from the element browser onto another diagram in the main view, is an EA-specific construct that has no basis in UML. Even within EA, they are strange beasts which fall somewhere between proper elements, which are shown in the project browser and can be dragged into any number of diagrams, and "pure" diagram objects which aren't shown in the project browser (such as Notes).
While you can draw connectors from one diagram frame to another in the normal ways, there is no way to create a connector going from an element within one frame, out of the frame's bounds and into another frame. This is because the elements within the frame are not actually present in the diagram which contains the frame; the frame is simply an image of the diagram it refers to.

Unbind Objects in Sparx Enterprise Architect

I have a class (let's call it "CLASS") in two different EA diagrams.
CLASS is the same object in both diagrams.
I want to change the attributes order in one diagram without it automatically changed in the other diagram too.
Any ideas?
Thanks.
That depends on what you want. Do you want to show different aspects of the same element in the two diagrams then you can play with the Feature and Compartment Visibility (Ctrl-Shift-Y)
If you want to show different elements, but one starting as a copy of the other then you can Copy the element (Ctrl-C) and Paste as duplicate (Ctrl-Shift-V)
You can not do that. And it does not make much sense to hide single attributes or methods of a class in specific diagrams. Either all or nothing (to show just the class). EA has a way to hide single stereotyped element parts for a whole diagram. But that's not what you're looking for.
Maybe you can explain WHY you want to do that.
No, you can't do that. As you note, it is the same element (avoid using the term "object" here; object is actually a type of element in UML, just like class, component, use case, etc).
Attributes can either be sorted alphabetically (by default) or in some custom order which you set manually, but EA stores this order with the class, not with the diagram. In other words, the attributes of one particular class will always be displayed in the same order in all diagrams.
New users often find this type of issue confusing or even frustrating, until they realize that a diagram is only a visualization of the underlying model data -- it is not a drawing. This is why you don't do search-and-replace in models: you make a change to an element in one place and it is immediately reflected wherever else that element is shown.
The only way to show two different attribute sort orders is to make a copy of the class, but then of course it's not the same element anymore.

How do I represent a component that is comprised of several files in a component diagram?

Since a single component could be manifested by multiple artifacts, I'd like to know how a component's multiple artifacts are represented in a component diagram. Or in other words if I have a component which is comprised by several files where the code of the whole component is implemented how can I draw the component diagram to make it clear the different files that comprise it?
Can I use a notation similar to a package where you can put the package symbol and inside the objects that the package contain? I mean, some sort of clickable component symbol where I double click and it opens showing the comprising files?
I use Enterprise Architect so examples using this will be even more helpful.
Regards!!
In Enterprise Architect, go to Component's properties (double click on the component box in the diagram) and go to files. That's the place to put the file list in Enterprise Architect.
Still, it's possible to model it in a way that a single file is represented as a separate component and thus "master" component is clickable so it is possible to navigate to another diagram, but when the model gets big and consists of many files it won't serve the purpose and it will get too complicated.
If for any reason, it is necessary to clearly mark the file list on the diagram, the note with textual description is sufficient.
Note that primarily a model (i.e. Component Diagram) is to show the parts of which the system is build and as opposite to the design, the file list is specific to the implementation.

Resources