What relationship we use to connect class and package for a class diagram? I'm using Power Designer tool.
Asked
Active
Viewed 887 times
1 Answers
0
Packages can include classes, so while this is not standard, I suppose you could use a composition relationship with a bunch of classes connected to a package with solid arrow lines, but this is not common. It is more customary to see a list of classes within the package element itself. Enterprise Architect does this and it is quite clear.
Note that a package is often implemented as a namespace. The package includes classes that belong in the namespace.

Bruce
- 2,230
- 18
- 34
-
What does your package represent? Is it a collection of the classes that you are referring to, or is it an interface to another set of classes? – Bruce Mar 28 '14 at 17:22
-
Hello, this is a package which contains both classes and interfaces, it could also contain and abstract classes. I'd really like to put some relationship which indicates, which class belongs to which package. So composition relationship, right ? – user3385945 Mar 28 '14 at 20:22
-
Yes, but this is not typical. How about if you have a package diagram showing the dependency relationships between the packages. Then, each package has an associated class diagram showing the associations between classes. To the class diagram, you can add interfaces from other packages and show which classes depend on those interfaces. – Bruce Mar 31 '14 at 13:50