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

Re: Class::FakeAttributes -- Opinions Wanted

Thread Previous | Thread Next
November 2, 2003 09:04
Re: Class::FakeAttributes -- Opinions Wanted
Message ID:
A. Pagaltzis writes:

> * Smylers <> [2003-10-31 10:55]:
> >
> This has been invented by Abigail quite a while ago and is called
> "inside out objects". See

Thanks for that.  Knowing that Abigail has used this technique gives me
confidence that it works!

However, even now I know the name for the technique I don't think it'd
be appropriate to call the module Class::InsideOutAttributes (or
similar), because that is describing the module's implementation rather
than the situation in which it is useful.

> There was some discussion on writing a Class::MethodMaker-ish module
> for this technique on PerlMonks, but it's very hard with the common
> state of Perl affairs.

I've never used Class::MethodMaker but it looks to be for helping you
create a class that needs lots of get_*() and set_*() methods to exist
for use by people creating objects in the class to get and set
particular attributes without needing to know how it is implemented.

Class::FakeAttributes helps in a different situation, where a class
author is subclassing something that is based on, for example, a scalar
ref but he/she wants to add instance data in the subclass.  The methods
in this class are intended to help the subclass author access the
attributes inside the class definition, not to provide public methods
for use by the people creating objects of that class.

> I don't really think it merits a module that can't do about as much as
> C::MM.

I don't think it's a case of not doing as much as, but of doing
something different.  Many of my classes don't have get_*() and set_*()
methods, nor would they benefit from having them.  Class::FakeAttributes
is designed to help with one specific situation, and I think giving it
capabilities to help with something that applies independently of that
situation would be confusing.

But if the consensus of this list is that I should remove
Class::FakeAttributes from Cpan then I shall do so.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About