Recently, needing to implement a factory pattern, I started using Class::Factory. It is a nice, easy-to-use base class for factory classes.
But what of the objects produced by my new, nice and shiny factory class, what are they like?
This is important because, if I am going to use a factory, then I need to know that objects produced by it respond to methods in a predictable way. They need the same, or almost the same, interface.
But of course, it's my factory class, and they are my objects, so I will write them all so that they conform to the interface.
The question is, is that enough? Should the factory classes check that any classes registered with them conform to the required interface?
And if I think I need this, should I do it with Class::Roles?