Hello all, we had a heated discussion about a method name.
We have a class User
. There is property called "Groups" on the user. It contains all groups that contain the user directly. That's ok. What we have problem with, is the name of the method that would recursively list all user's groups and their "parent" groups and return list of all groups, of which the user can be considered as member.
User u = <get user>;
IList<UserGroup> groups = u.XYZ();
Console.WriteLine("User {0} is member of: ", u);
foreach(UserGroup g in groups)
Console.WriteLine("{0}", g);
My colleagues brought:
u.GetAllGroups(); // what groups?
u.GetMemberOfGroups(); // doesn't make sense
u.GroupsIAmMemberOf(); // long
u.MemberOf(); // short, but the description is wrong
u.GetRolesForUser(); // we don't work with roles, so GetGroupsForUser ?
u.GetOccupiedGroups(); // is the meaning correct?
What name would you propose?