Thanks for the answers. To reiterate, here is a quote from the comments to the article Greet posted the link to:
I’d like that tools like EA would be able to automatically show the associated classes as attributes of the class. This would be very helpful when dragging a class to another diagram.
To address some of the questions above:
i do talk about the composition in this particular case, so my example would be more accurately described as (even though it involves the instantiation of a classifier - can't find another easy way to describe it...):
//pseudocode:
ClassA {
ClassB b = new ClassB()
}
Ie, ClassA as the composite object has responsibility for the existence and storage of the composed objects (parts - in this case, ClassB). But generally it doesn't matter much in the context of my question. I'd expect the same principle working working for the aggregations as well (as in your example).
As for the reason or intent of why i need it. It's not to reverse engineer the code, but to 'traverse' the UML model in order to do a sort of 'impact analysis'. I was hoping that if classifier is a composite object defined through typed attribute, i still would be able to traverse the model from ClassA to ClassB through 'composite' or 'aggregate' association. Or yet in other words, when traversing the UML model from an arbitrary element, I need to trace all classifiers of type 'X' which are 'reachable' from that selected element. Similar to what 'Tracability' window within Sparx does, but in a more readable format, with an ability to set various filters. From what I understand, if I just traverse JUST the associations / links, I won't be able to find the references to 'attributes' of type 'X' (same as 'Traceability' tool won't be able to find these relationships to the attributes).
Another thing I can't understand is the 'owns' association. If I drop one classifier within another (eg, Class2 into Class1), Class2 will be 'contained' within Class1 in the project browser, the Traceabiltiy tool will show the relationship between Class1 and Class1.Class2 as 'owns' (ie, <Class1> [owns] <Class1.Class2>), but the Relationship tool will NOT show this relationship. On the other hand, if I define explicit 'nesting' relationship between Class1 and Class2 as 'Class2' nested in 'Class1', the tracability tool will show this relationship in exactly the same fashion (<Class1> [owns] <Class2>), but this time around the relationship WILL be shown in the relationship tool as 'Nesting'. I thought that 'Traceability' and 'Relationship' tools use the same approach when they derive the relationships between the elements... Seems like they are not.
Vlad