Search code examples
umloclpapyrus

Layering derived objects in Papyrus by OCL


Being new to UML/OCL/Papyrus the lack of exchange about this gives me a feeling I might be on the wrong path:

Working on a class diagramm I would like to layer a) all objects that are members of a composition and b) all interfaces that inherit from another interface. That is, I would say, layering by direct and indirect association.

In papyrus I could do this by simply adding elements to a layer. More convenient would be the use of Reg Exp Layers, which select all elements returning TRUE on an OCL boolean expression. As an example, it is easy to put a single element on its own layer via self.element.oclAsType(uml::NamedElement).name='myclass'

But I would also like to put all (downwards) associated elements of 'myclass' on that layer. Any suggestions?


Solution

  • Answer from: https://www.eclipse.org/forums/index.php/mv/msg/1087968/1769850/#msg_1769850

    While layers may allow you to fold multiple logical diagrams into a single diagram, it seems very misguided.

    I find that once diagrams get non-trivial, it is helpful to draw one diagram showing the inheritance architecture, another the containment architecture and perhaps further diagrams for the construction/destruction, communication architectures. Forcing a positional sharing with layers seems to create an undesirable limitation. Remember a UML Diagram is a view of the underlying Model. You may have many Diagrams for different views.