Assuming everyone has the rights to do the CRUD operations (everyone is an admin type user). I have displayed CRUD operations the user can perform in the Domain diagram however, it's become quite messy. I am curious if it's acceptable to do the alternative approach shown in the images below instead since the multiplicative relationships remain the same for each action (create,edit,delete)
If it becomes messy, it probably lacks of separation of concerns, or represents associations that are not really needed.
Are the associations needed?
An association between User
and Xxx
implies a semantic relationship between the two classes. This means that instances of the classes are linked and not just for the time of an operations. So x
would be able to find the User
(s) that updated it, and u
would know the Xxx
instances that it updated. This kind of association can make sense if you want some audit trails, but this seems not to be your purpose here.
In other words, the fact that a User
may perform some operations that CRUD instances of Xxx
is not sufficient for justifying an association.
If they are needed, do they represent what you think?
Now it appears that your associations are can ...
, i.e. some kind of authorisation scheme. Your diagram tells that each user would need to know in advance all the Xxx
that it could update. This is a heavy burden. It would also imply that a user needs to know all the Xxx
it can create; before they are even created? This looks somewhat inconsistent.
Modeling an authorisation scheme
If you'd wand to design an authorisation system, you'd probably not link users directly to the object, but use some intermediary mechanisms:
Separation of concerns
And to keep things continue to be messy, you should consider: