Search code examples
javaumlsequence-diagram

Confused by sequence diagram including <<METACLASS>>


I'm looking for some clarification on this assignment I have. We are supposed to type up the code (not asking that of anyone on here) of this diagram but I do not understand exactly whats going on. enter image description here

Based on me research, I understand that all classes are instances of a metaclass, but what I dont understand is are the objects frame, context, and diagram supposed to be objects of our metaclass? or are they independant from the metaclass? Or can you even tell that based on the diagram? I would be able to do this just fine without the presence of the metaclass.


Solution

  • A Sequence Diagram does not document inheritance hierarchies.

    To figure out if any of the instances in your sequence diagram inherit from that Metaclass, you would need to refer to Class Diagrams and/or Profile Diagrams.

    I would not just ignore that Metaclass, since the sequence diagram clearly shows it exists. It could be the (logical) base class for real class(es) that come from a library or framework on which your code depends.

    Judging from the sequence diagram, it looks like Frame does NOT inherit from GraphUtilities, since if it did it could have just sent the format and getColor messages to itself. Also, generally speaking, most "utility" classes are not designed to be subclassed.