How would you use UML to model the following relationship? A user has many privileges, one privilege is authorized to one domain. The code is as follows:
public class User
{
private Vector privileges;
}
public class Domain
{
private Vector domainEntites;
}
public class Privilege
{
private User theUser;
private Domain theAuthorizedDomain;
}
One choice would be to use aggregation and association.
1 1
User<>--------Privilege------->Domain
1 0..n |------>User
1 1
Another choice would to use association and association class.
1 0..n
User----------->Domain
|
|
Privilege
Which of these is better? Are there other alternatives?