I have quite a few Helper classes in my project. I have read that this is a bad thing, but I suspect that "Helper" is the wrong suffix for them. I'll give an example.
First, I have a User
class. I need a method GetSuggestedFriends()
for a user. I want to keep the logic for determining the list of suggested friends out of the User
class, so it doesn't get bloated. Right now, I have a FriendshipHelper
which receives a User
in its constructor. It contains the logic for getting suggested friends, and I can now call myUser.FriendshipHelper.GetSuggestedFriends()
.
Originally FriendshipHelper
had static methods only, and a User
object was passed into each one. If I was writing the class from scratch now, maybe I'd call it FriendshipManager
- it also does things like adding and removing friends.
I've also read that ...Manager
classes are bad, though. What should I call this class? Or, is this "bad code"? Where should the logic for getting suggested friends, current friends, and adding and removing friends live? Surely not all in a giant User
class?
Facebook
?