Search code examples
umlproject-structurebehavior

Structure and behavior in UML


I had some questions regarding the structure and behavior of a model, using UML, and the relationship between the two :

  1. Did you find any limitations for UML regarding the specification or understanding of the relationship between structure and behavior?
  2. I was wondering if you have any practical ideas of how one can optimize the relationship between structure and behavior, using UML.
  3. Do you know any UML tools that help understand better this relationship or represent it much easier?

Thanks


Solution

    1. Yes:

      • A sequence diagram is readable at a high level, showing how a transaction involves a few components; but it's not good (not readable) at the detailed level, showing how a transaction involves dozens of methods (method A calls method B, which gets data from methods D and E, and then invokes method F, etc.).

      • Looking at a class diagram, you might see a based class with several subclasses; this tells you nearly nothing about the behaviour of the classes (it only tells you that they may have some behaviour in common, or at least a common API, plus some individual behaior that's unique to each subclass).

    2. That's a big question. A quick answer is, "Attach text notes to the objects: diagrams aren't sufficient without descriptive text."

    3. No, I don't really; a UML tool help you create UML diagrams (and generate code from the diagrams), but it's up to you how you use it. There was a neat product described in the book titled Real-Time Object-Oriented Modeling (1994) which was an executable model, i.e. the model itself had behaviour, but I know of no UML tool quite like that. The closest I know of is being able to "round trip" between the model and code (i.e. generate code from the model, and the model from code).