Say that creating/calculating all the properties of fruit needs a lot of logic, and you just want to have a very simple immutable POCO object in the end.
So i.e. it doesn't have any methods, making it really easy to reason about, and also easily and clearly serializable.
Right now I have something names like this:
class BananaCalulator { public Banana Calculate() }
class Banana {}
class AppleCalulator { public Apple Calculate() }
class Apple {}
Is this a common pattern? Is there a more common terminology instead of Calculator?
BananaCalculator
has a lot of logic that I don't want to have in theBanana
result, because after it has been calculated all this code (and extra methods) makes it harder to reason about - they will be an unnecessary distraction.