I'm writing in c++, I have a base class let's call it base, that has 2 children classes. the requierements are:
- Singleton, also the base class can't be initialized as object
- the base class has a function to create an instance, which will choose on runtime what child object to create (not sure if this is a good logic, but the base class is responsible on choosing and initiating a child).
- The base class also holds multiple functions that the children share.
- Then there are multiple pure virtual funtions that only the children implement.
I'm thinking of some combination of singleton + factory patterns, but not sure how to use factory here.
Aucun commentaire:
Enregistrer un commentaire