Alex Rivera | Logout

What would you name this CRUD class?

Asked 2009-05-08T18:33:38.607
10

Trying to avoid the SomethingManager trap here...

Let's say I'm going to write a User editor which will allow administrators to create users in the system. Pretty basic functionality - view a list of existing users, create a new user, update an existing user, delete a user.

Let us also say that I decide to write a "business" class to handle these basic CRUD operations. This is probably what the interface would look like:

public interface ISomeUsefulName
{
    IList<User> FetchUsers();
    User FetchUser(int userId);
    bool SaveUser(User user);
    bool DeleteUser(int userId);
}

Inside the SaveUser() method, for example, I would validate the data (using a different class) and then actually save the data to the database (again using another class).

My question is, what should I name this class? Is this class doing too much and therefore I should split it into multiple classes?

Edit
Report

2 Answers

3

IUserRepository or IUserServices.

answered 2009-05-08T18:46:45.297
1

Why not just IUserCRUD? CRUD has, as oposed to 'manage' no 10 meanings.

answered 2009-05-08T18:38:08.703

Your Answer