Search code examples
classunity-game-enginepackageumlclass-diagram

Using packages in class UML diagram


So, is it possible to use packages in class diagram in UML notation? And how? I need to draw a class diagramm of unity3d project and most of classes are connected through UnityCore. Using packages is my first idea, but I'm not sure that it correctly. Thanks for any help!


Solution

  • Package diagram is a general type of diagram which is used all over a model with all other diagram types. Packages structure your model, just like folders organize your file system. They permit you to make your model content clearer and easier to understand, read, navigate...

    Concrete meaning of a package depend on the elements it contains. It could be very formal (for example it can represent a DB and its contents (classes) are tables in the DB) or purely organizational (for example overall organization of the model "Use cases" package, "System design" package, etc.

    In context of classes, packages can be used to encapsulate subsystems and expose interfaces (on implementation level), already mentiones DB example, etc.

    Typical relationsip between 2 packages is a dependency. It means that an element from one package depend on an element from another package. UML defines a couple of relationships more, but they are relativelly rarely used.

    UPDATE

    Note that even on a pure class diagram it is clear that Class2 comes from another package.

    enter image description here