--------------------------------------
On a personal note, I'm having trouble convincing people of the size of the monster that lives with me so I thought I'd use my web space to temporarily post a pic. He's a black Maine Coon cat. The table that he's standing on is about 3 1/2 ft. in diameter. I don't know if you guys have ever seen a Maine Coon but they're enormous. Everyone, I'm pleased to introduce Lucky:
[edit]
I came to a realization. When dealing with factory methods, there's a way to insure that the factory method of you child calsses are implemented.
I have a CAction class with a factory method. I use a CActionProcessor object that registers, maps and executes CAction objects. CAction is an abstract class and requires that the Factory method is implemented. Instead of using a stub in the parent class, the parent class simply returns NULL. This works well where you want to use the CAction class for a different solution but still want a default Factory method to get it to compile. So if I say
CAction * Factory () = 0;
in the header file, I can't compile without implenting the method. On the other hand, I can impliment it as such:
CAction *CAction::Factory () {
return NULL;
}
Now I can instantiate the class without worrying about the Factory method but my CActionProcessor class will ignore anything that returns NULL. In some applications, this could be a little messier and the previous stub would be a better fit. I just kinda dig this option because it allows a bit more flexibility.