I was working on a UML class model and (basic as it is) I feel I need to see if my assumption is right. I have two types: Administrator and Location. (A relationship exists between the two where an Administrator can be at one or more locations).
An Administrator needs to assign themselves to a Location. Should this assignment operation be in the Location type or the Administrator type? What is the reasoning for one over the other?
Both are possible and with argumentation, both could also be just fine.
If the administrator is logged in at the main server, he could invoke
AdminUtils.Locations(That).AddAdministrator(Me). On the other hand, if the administrator is at a specific location he could, prior to logging in at that location, invokeAdminUtils.Administrators(Me).AddLocation(This).These kind of questions are for specific situations generally answered by considering responsibilities. Which entity is responsible for which entities?
Also note that these Add methods could perfectly be elements of both entities, but one of them is mapped to the actual storage which should be just one.