retaining original class hierarchy

Dirk Koopman djk at tobit.co.uk
Sun Aug 6 15:45:55 BST 2006


On Sun, 2006-08-06 at 15:13 +0100, Dirk Koopman wrote:
> I have a factory class called 'Foo'. It has several subclasses like:
> 'Foo::TypeA', 'Foo::TypeB' and so on. Each of these subclasses has a
> different version of 'method'.
> 
> There a stash of objects of these different subclassed type such that a
> function Foo::get('main') will return an object of, say, 'Foo::TypeB' -
> BUT - you don't know what that object's class will be.

<etc>

Here is a working example of it not doing what I want :-)

What I want is each object to inherit the type that it was created with
in the stash (not the last one as this program demonstrates).

Dirk


More information about the london.pm mailing list