Reputation: 13551
The term factory applies to objects that create and return objects.
Is there are term for classes that modify other objects and return that modified object? I looked for terms like 'Processers' and 'Modifiers' but didn't turn up much (other than access modifiers).
I have a lot of helper classes and I would like to use the proper terminology, if possible, to describe all these 'processing' classes. e.g. filterProcesser, layoutProcesser, etc.
Upvotes: 0
Views: 51
Reputation: 8711
If your method modifies an object, then it should not return a value. If your method returns a value, then it should not modify anything - That's what CQS is all about
When you modify another object you perform a command. There's already existing terminology for such methods - they are called Controllers
is there are term for classes that modify other objects and return that modified object?
So as you already know this breaks the CQS since they also return an object.
But if you still insists, there's nothing wrong with naming conventions until they don't break the POLS (Names should be saying exactly what they do)
Also, keep in mind, that good methods should be small and do only one thing
Upvotes: 1