develooper Front page | perl.module-authors | Postings from November 2003

Re: Class::FakeAttributes -- Opinions Wanted

Thread Previous | Thread Next
From:
A. Pagaltzis
Date:
November 6, 2003 09:06
Subject:
Re: Class::FakeAttributes -- Opinions Wanted
Message ID:
20031106170539.GA7786@klangraum
* fergal@dyn.fergaldaly.com <fergal@dyn.fergaldaly.com> [2003-11-04 12:30]:
> use My::OutOfBandLexicalThing qw( Attr Attr2 Attr3 );
> 
> and you'd get lexically scoped, overload worry free, out of
> band attrs without any bothersome typing.

* A. Pagaltzis <pagaltzis@gmx.de> [2003-11-06 18:00]:
> I'm not interested in where the attribute is stored. I'm
> talking about the attribute. Whether it is accessed by hash
> lookup or closure call makes no difference. In Yves' code, the
> attribute is only accessible to the method in its scope (by
> looking it up in the lexically scoped hash), while using your
> code, the attribute would be accessible globally (by calling
> the exported function).

Of course, my point is only valid for cases where it is not
desired for the "naked" attribute to be accessible, but rather
that the accessor be able to present a computed value f.ex from
several compound private attributes, or a mutator be able to set
computed values or even just to verify values before setting
them.

In that case, you have to implement the insideout-ness yourself
as per Yves' code, rather than using your method maker.

-- 
Regards,
Aristotle
 
"If you can't laugh at yourself, you don't take life seriously enough."

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About