mardi 23 juin 2015

(Abstract Factory) Why do this when you can't use new methods in the derived classes?

I am reading about the Abstract Factory Pattern. As far as I understand, the client code is going to have references to the constructed objects via the abstract interface. This means that if you extend the abstract factory to make objects that have new methods, you can't call them. This seems like a tight restriction. Why have all these subclasses when the client won't even be able to access any new methods or variables?

Aucun commentaire:

Enregistrer un commentaire