Paolo,
What you state;
- Sometimes I think you use the term diagram to mean the rectangular notation where each rectangle is the rendering of a class' metadata.
Yes this is correct
Ah... I suspected that from your very first post, but I was hoping I would not have to explicitly ask... However, it is better to ask than suspect. Your use of diagram in this way is part of the reason it has taken us (Sparxian KP and myself) so long to (hopefully) resolve the issue for you.
If you look at the definition of the term diagram (taken from EA's Help file - but good enough for our purposes) the diagram is the frame in which there are three shapes (or vertexes - vertices for the Latin scholars) - Class A, Class B and Class C.
A diagram is just a collection of shapes and lines (Vertexes and Edges or Nodes and Arcs or any mixture of the respective terms). I think what you call a
Logical View is what the rest of us call a
diagram. The notion that there is a diagram for Class A is not strictly correct. There can be a diagram that contains shape A and other shapes, or there can be a diagram that is somehow linked to shape A and tells you something about shape A without having an explicit reference to shape A. In other words,
you decide the semantic content (meaning) of a diagram. EA provides the ability to associate one diagram with a shape so that if you double click the shape on any
other diagram, it will open the associated diagram. This is the functionality I discussed in my first reply to you. Since you are a UML newbie, the irony and humour in the explanation may have made you a bit more confused - but just as you were using the term diagram in a rather unique way, Sparx also uses terms in unique ways. If you want to associate a diagram with a shape, you need to use the "Composite Element" functionality
even if the shape you are associating with is not actually a composite element.So, to summarise, EA creates diagrams that can contain shapes and lines. Some of those shapes can be classes. A shape can have an associated diagram so that if you double-click the shape, the associated diagram will be opened by EA.
- I would expect EA to reverse engineer that to 1 diagram with 3 elements, A B and C. A and B would be connected by a line (with adornments) and likewise A & C.
This is exactly what I get when I reverse engineer the code. Now how would one move the B and C class diagrams to their own logical views and reference them from class A's logical view?
Hopefully, you now understand that from a UML viewpoint, when we reverse engineer the A, B and C classes above, you should get the diagram I described and you actually got.
If you are forward engineering,
you control which diagrams get created and what their content is. If you reverse engineer, depending upon the options you select, EA will automatically create some diagrams on a per namespace or per directory basis. As you suggest, if there are a lot of classes in these containers, than there will be a lot of classes in the diagrams.
Normally, users create their own diagrams and ignore the ones created by EA. As you'll read in many posts on the site, the model is a communication mechanism, so you need to decide what each diagram is trying to convey and place the appropriate shapes and lines to do that.
To get back to your original post, it is normal practice for a diagram to show a class and its associated classes. Thus, you'd get the diagram you got from reverse engineering - which could be said to be Class A and it's associated classes: Class B and Class C. You could construct another diagram call it Class C which would show Class C and it's associated classes: In our example, this would be class A - there's not direct connection to B. If you create a new diagram and drag class C onto it (from the browser), you will have a diagram with a single class shape (Class C). If you then drag Class A onto it, EA will automatically add the Composition Association between A and C for you!.
Now, it will occur to you that this is quite tedious for large diagrams or well connected classes. And any way - how do you know which classes are connected to which in a large model? Well, EA knows! Create a third diagram, This time drag Class B onto it. Select it, and then use
<Context Menu>|Add>Insert Related Elements - EA will automatically add to the diagram (using the default option) all the stuff that is connected to Class B. This is how most users create diagrams from existing information. You can then edit the diagram to show only what you want to show.
So does that help explain what's going on?
Paolo