Skip to main content
edited tags
Link
gnat
  • 20.5k
  • 29
  • 117
  • 310
Source Link
Lukmo
  • 265
  • 1
  • 6

Lots of classes with only one single static method with same name as class - Code smell?

I'm trying to follow the single responsibility principle (SRP) in my applications. I have lots of CRUD classes I just name xxxxxManager.

Following the SRP, I made 4 classes for each one :

xxxxxCreator, xxxxxGetter, xxxxxDeleter, xxxxxUpdater

They end up having only one static method : xxxxxCreator::create(Model $model), xxxxUpdater::update(Model $model), etc.

This is a code smell for me. Am I pushing the SRP too far ?