APM: Inverted objects?

Montgomery Conner montgomery.conner at gmail.com
Fri Sep 14 17:02:01 PDT 2007


AFAIN this tactic was originally proposed by Damian Conway in his 2000 book
'Object Oriented Perl'... the implementation is typically called 'inside-out
objects'.

These have been implemented in dozens of ways over the last few years, but
perhaps the best explanation and description is the documentation that comes
with Damian's own Class::Std... here:
http://search.cpan.org/~dconway/Class-Std-v0.0.8/lib/Class/Std.pm<http://search.cpan.org/%7Edconway/Class-Std-v0.0.8/lib/Class/Std.pm>


good luck,
Montgomery



On 9/14/07, Tim McDaniel <tmcd at panix.com> wrote:
>
> I dimly recall a presentation about "inverted objects" or some phrase
> like that.  The standard Perl procedure boils down to
>      my $obj = {};
>      $obj->{foo} = 123;
>      $obj->{bar} = 456;
>
> The technique was something like
>      my $obj = \0;  # some way of generating a unique reference
>      $foo{$obj} = 123;
>      $bar{$obj} = 456;
> This allows compile-time "member" checking and perhaps other
> advantages that I don't recall right now.
>
> Who thought of this pattern (was it Schwartz?) and where can I read up
> on it again?
>
> --
> Tim McDaniel, tmcd at panix.com
> _______________________________________________
> Austin mailing list
> Austin at pm.org
> http://mail.pm.org/mailman/listinfo/austin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/austin/attachments/20070914/5eb6841b/attachment-0003.html 


More information about the Austin mailing list