Skip Menu |

This queue is for tickets about the Class-Accessor CPAN distribution.

Report information
The Basics
Id: 17836
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: Class-Accessor

People
Owner: Nobody in particular
Requestors: cbrandt [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Add ability to provide your own alias for accessors
I was wondering if it would be possible to add the ability to designate your own alias for created accessors. Basically, I'd like to be able to generate accessors called get_field and set_field. There is some discussion here http://perlmonks.org/index.pl?node_id=531997 If you think it might be an option, I could try to submit a patch, but it might be tricky to create something that doesn't break the current interface. Thanks, Jim
Subject: Re: [rt.cpan.org #17836] Add ability to provide your own alias for accessors
Date: Fri, 24 Feb 2006 15:22:13 +0000
To: Jim Brandt via RT <bug-Class-Accessor [...] rt.cpan.org>
From: Marty Pauley <marty+perl [...] kasei.com>
On Thu Feb 23 16:23:44 2006, Jim Brandt via RT wrote: Show quoted text
> > I was wondering if it would be possible to add the ability to designate > your own alias for created accessors. Basically, I'd like to be able to > generate accessors called get_field and set_field.
I should be able to add optional autogeneration of get_foo and set_foo without any problems. The ability to designate your own aliases is not difficult to add; getting the interface right is the only tricky part there. I'll look at it over the weekend. -- Marty
Subject: Re: [rt.cpan.org #17836] Add ability to provide your own alias for accessors
Date: Fri, 24 Feb 2006 12:45:56 -0500
To: bug-Class-Accessor [...] rt.cpan.org
From: Jim Brandt <cbrandt [...] buffalo.edu>
Marty Pauley via RT wrote: Show quoted text
> On Thu Feb 23 16:23:44 2006, Jim Brandt via RT wrote:
>> I was wondering if it would be possible to add the ability to designate >> your own alias for created accessors. Basically, I'd like to be able to >> generate accessors called get_field and set_field.
> > I should be able to add optional autogeneration of get_foo and set_foo without > any problems.
Cool. That's really my main request, and as you can see from the link, my main driver was setting up methods to follow Damian's PBP book. Not just because it's in a book, but because I agree with the guideline. :) Show quoted text
> > The ability to designate your own aliases is not difficult to add; getting the > interface right is the only tricky part there.
That was my thought too. Tricky to add it without breaking the current interface. I thought this bit might just be the natural extension of the other request. Show quoted text
> > I'll look at it over the weekend.
Thanks for taking a look. Let me know if I can help. Jim -- Jim Brandt Administrative Computing Services University at Buffalo
I have added a 'follow_best_practice' class method to make Class::Accessor generate 'get_foo' and 'set_foo' methods instead of the 'foo' method: __PACKAGE__->follow_best_practice I've also added the accessor_name_for and mutator_name_for methods that can be overriden in a subclass. -- Marty
Subject: Re: [rt.cpan.org #17836] Add ability to provide your own alias for accessors
Date: Fri, 26 May 2006 15:27:05 -0400
To: bug-Class-Accessor [...] rt.cpan.org
From: Jim Brandt <cbrandt [...] buffalo.edu>
Thanks very much for doing this. I haven't had a chance to try out your new implementation yet, but it's on my list. Jim via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=17836 > > > I have added a 'follow_best_practice' class method to make > Class::Accessor generate 'get_foo' and 'set_foo' methods instead of the > 'foo' method: > > __PACKAGE__->follow_best_practice > > I've also added the accessor_name_for and mutator_name_for methods that > can be overriden in a subclass. > > -- > Marty >
-- Jim Brandt Administrative Computing Services University at Buffalo
Subject: Re: [rt.cpan.org #17836] Add ability to provide your own alias for accessors
Date: Fri, 26 May 2006 15:27:05 -0400
To: bug-Class-Accessor [...] rt.cpan.org
From: Jim Brandt <cbrandt [...] buffalo.edu>
Thanks very much for doing this. I haven't had a chance to try out your new implementation yet, but it's on my list. Jim via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=17836 > > > I have added a 'follow_best_practice' class method to make > Class::Accessor generate 'get_foo' and 'set_foo' methods instead of the > 'foo' method: > > __PACKAGE__->follow_best_practice > > I've also added the accessor_name_for and mutator_name_for methods that > can be overriden in a subclass. > > -- > Marty >
-- Jim Brandt Administrative Computing Services University at Buffalo