So I have a base class which has protected properties and also implements an interface.
The method in the interface, its signature has been changed in the base class to be abstract as I want the children/inheritors override/implement this method.
So now I will have a range of classes, lets call them:
All this inherit from "HumanBase", which implements an interface as explained above.
Now, I need to have some factory of some kind where it will return me the correct type of object but as an Interface i.e:
so thats ok.
public IHuman Create(string stuff)
// here create the concrete class and return it
But here is the problem:
how would I set all the base properties etc... from the HumanBase from this factory type pattern? I know you can only access protected properties from the base class itself and also the children that inherit from the base class.
What I mean is, should each of the classes (baby, toddler etc...) have a constructor which takes in the parameters and then in the constructor let it set itself up?