How do I name a method that lists groups where user is a member of?
04:01 14 Oct 2008

Class User has property Groups. It contains all groups that contain the user directly. We have a problem with the name of the method that recursively lists all user's groups and their parent groups and returns a list of all groups of which the user is a member.

User u = ;
IList 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?

coding-style