No such thing as a small change | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
So, in a nutshell, your objects of class "Thing" contain the class name of the back end class, in the hash member $x->{backend}. As far as I am concerned, this is perfectly acceptable.
There may be alternatives, if for instance you actually need to have (and keep track of) an object blessed into the back end class, associated with the "Thing" object. In this case, you would just store a reference to this object (you can then get its class name using ref if you really want it). Another alternative is the factory pattern, where method calls in your "Thing" class spit out backend objects given parameters, etc. It's a case of TIMTOWDI. -- In reply to Re: how do you call this? $x->bar();
by rinceWind
|
|