in reply to Howto implement versions of object instances
The only good option I can think of is to put your interfaces in MyModule::V1_0 and MyModule::V2_0, respectively, and then bless your object into one of these packages.
If that’s out of the question, you’ll need some way to hook into the method lookup, and the only way to do that is with AUTOLOAD.
Okay, there’s another way, but it’s rather brutish: put the methods in different packages as outlined above, then iterate over their symbol tables, picking out the functions, and assign a to the same symbols in MyModule a stub function that routes the call to the right package’s method.
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Howto implement versions of object instances
by pajout (Curate) on Nov 15, 2005 at 12:07 UTC |