1

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!

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

2 Comments

Ok, thx. But i need to show that class from first package generalize class from second package? for example. Can i show it in package diagram like this link?
That's valid, although not very common. More usually, a single UML diagram shows either only packages with their dependencies (no classes), or a view on the content of a single package (or part of it). The reason is model scalability - as you will normally have more elements in each package and maybe more packages, it is better to start breaking down the model structure and keep each diagram simple. I would make two clean and simple diagrams instead of the mixed one from your example (see the answer update).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.