A mathematician confided
That the möbius band is one sided.
You'll have quite a laugh
If you cut one in half,
'Cause it stays in one piece when divided.
I had an idea for a joke module, that provides möbius objects: inside out objects that are also not inside-out. However, thinking more about it, I can see that this could have practical uses.
Imagine the scenario of refactoring in-house modules for inside outedness. The modules themselves could be refactored to use Class::Std, Object::InsideOut, Class::InsideOut or whatever, but lots of existing legacy code could break if it is relying on de-encapsulation ->{foo} syntax.
Möbius objects could provide a migration path allowing the legacy code to still work, albeit generating warnings whenever encapsulation is violated, but still working.
Inside out objects tend to be implemented as a blessed scalarref, using the address or some other unique low level property (their values are not actually used). The möbius object could still use this address, but be a blessed, tied hashref or arrayref. The tie mechanism will intercept any attempts to access attributes directly, and will do the right thing, generating warnings as necessary.
What do others think? Is this idea worth pursuing? Or should it retain "joke module" status?
--
Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: RFC: Class::Moebius
by xdg (Monsignor) on Jan 11, 2006 at 12:59 UTC | |
|
Re: RFC: Class::Moebius
by robharper (Pilgrim) on Jan 12, 2006 at 09:43 UTC | |
by rinceWind (Monsignor) on Jan 12, 2006 at 12:09 UTC | |
|
Re: RFC: Class::Moebius
by chromatic (Archbishop) on Jan 12, 2006 at 07:29 UTC | |
|
Re: RFC: Class::Moebius
by TomDLux (Vicar) on Jan 11, 2006 at 18:57 UTC | |
by pajout (Curate) on Jan 12, 2006 at 09:36 UTC | |
|
Re: RFC: Class::Moebius
by rrwo (Friar) on Feb 18, 2006 at 14:48 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |