How to apply Single Responsibility Principle to a service class

Posted by Shekhar on Stack Overflow See other posts from Stack Overflow or by Shekhar
Published on 2010-04-15T07:53:04Z Indexed on 2010/04/15 8:03 UTC
Read the original article Hit count: 323

Hello

Suppose we are designing a UserServiceImpl class which does CRUD(Create, Read, Update, and

Delete) operations. In my view Create, Read, Update, and Delete are four reasons for a

class to change. Does this class violates Single Responsibility Principle? If it violates,

then should we have four classes like CreateUserServiceImpl, ReadUserServiceImpl,

UpdateUserServiceImpl, and DeleteUserServiceImpl. Isn't it an overkill to have lots of

classes?

Thanks

Shekhar

© Stack Overflow or respective owner

Related posts about object-oriented-design

Related posts about single-responsibility-pri