Improving generate accessors for refactoring browser

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Improving generate accessors for refactoring browser

Bart Gauquie
Dear list,

I've noticed that when I'm using the generate accessors refactoring, I'm always adapting the generated code for the mutator:

number: anObject
    number := anObject

to: 

number: aNumber
   number := aNumber

So I've adapted the refactoring code a bit so that it automatically generates this correctly. Anybody also thinks this is useful? If so, I will create a bug/improvement and a slice for it.

Kind regards,

Bart

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Improving generate accessors for refactoring browser

Mariano Martinez Peck

i would like that too

On Sep 12, 2010 7:27 PM, "Bart Gauquie" <[hidden email]> wrote:

Dear list,

I've noticed that when I'm using the generate accessors refactoring, I'm always adapting the generated code for the mutator:

number: anObject
    number := anObject

to: 

number: aNumber
   number := aNumber

So I've adapted the refactoring code a bit so that it automatically generates this correctly. Anybody also thinks this is useful? If so, I will create a bug/improvement and a slice for it.

Kind regards,

Bart

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Improving generate accessors for refactoring browser

Lukas Renggli
How you derive the type?

From the method name? I think only very few accessors/inst-vars are
named after the type.

Also note that you can edit the type directly in the changes browser
before you install it, that's what I typically do.

Lukas

2010/9/13 Mariano Martinez Peck <[hidden email]>:

> i would like that too
>
> On Sep 12, 2010 7:27 PM, "Bart Gauquie" <[hidden email]> wrote:
>
> Dear list,
>
> I've noticed that when I'm using the generate accessors refactoring, I'm
> always adapting the generated code for the mutator:
> number: anObject
>     number := anObject
> to:
> number: aNumber
>    number := aNumber
> So I've adapted the refactoring code a bit so that it automatically
> generates this correctly. Anybody also thinks this is useful? If so, I will
> create a bug/improvement and a slice for it.
> Kind regards,
>
> Bart
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Improving generate accessors for refactoring browser

Miguel Cobá
El lun, 13-09-2010 a las 14:02 +0200, Lukas Renggli escribió:
> How you derive the type?

I think it only uses the name of the inst var to name the parameter var
in the accessor.

>
> >From the method name? I think only very few accessors/inst-vars are
> named after the type.
>
> Also note that you can edit the type directly in the changes browser
> before you install it, that's what I typically do.
>
> Lukas
>
> 2010/9/13 Mariano Martinez Peck <[hidden email]>:
> > i would like that too
> >
> > On Sep 12, 2010 7:27 PM, "Bart Gauquie" <[hidden email]> wrote:
> >
> > Dear list,
> >
> > I've noticed that when I'm using the generate accessors refactoring, I'm
> > always adapting the generated code for the mutator:
> > number: anObject
> >     number := anObject
> > to:
> > number: aNumber
> >    number := aNumber
> > So I've adapted the refactoring code a bit so that it automatically
> > generates this correctly. Anybody also thinks this is useful? If so, I will
> > create a bug/improvement and a slice for it.
> > Kind regards,
> >
> > Bart
> > _______________________________________________
> > Pharo-project mailing list
> > [hidden email]
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
> > _______________________________________________
> > Pharo-project mailing list
> > [hidden email]
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
>
>
>

--
Miguel Cobá
http://miguel.leugim.com.mx


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Improving generate accessors for refactoring browser

Bart Gauquie
don't use the type, i only uses the name of the parameter var to derive the name of parameter

2010/9/13 Miguel Enrique Cobá Martínez <[hidden email]>
El lun, 13-09-2010 a las 14:02 +0200, Lukas Renggli escribió:
> How you derive the type?

I think it only uses the name of the inst var to name the parameter var
in the accessor.

>
> >From the method name? I think only very few accessors/inst-vars are
> named after the type.
>
> Also note that you can edit the type directly in the changes browser
> before you install it, that's what I typically do.
>
> Lukas
>
> 2010/9/13 Mariano Martinez Peck <[hidden email]>:
> > i would like that too
> >
> > On Sep 12, 2010 7:27 PM, "Bart Gauquie" <[hidden email]> wrote:
> >
> > Dear list,
> >
> > I've noticed that when I'm using the generate accessors refactoring, I'm
> > always adapting the generated code for the mutator:
> > number: anObject
> >     number := anObject
> > to:
> > number: aNumber
> >    number := aNumber
> > So I've adapted the refactoring code a bit so that it automatically
> > generates this correctly. Anybody also thinks this is useful? If so, I will
> > create a bug/improvement and a slice for it.
> > Kind regards,
> >
> > Bart
> > _______________________________________________
> > Pharo-project mailing list
> > [hidden email]
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
> > _______________________________________________
> > Pharo-project mailing list
> > [hidden email]
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
>
>
>

--
Miguel Cobá
http://miguel.leugim.com.mx


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



--
imagination is more important than knowledge - Albert Einstein
Logic will get you from A to B. Imagination will take you everywhere - Albert Einstein
Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning. - Albert Einstein
The true sign of intelligence is not knowledge but imagination. - Albert Einstein
However beautiful the strategy, you should occasionally look at the results. - Sir Winston Churchill
It's not enough that we do our best; sometimes we have to do what's required. - Sir Winston Churchill

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Improving generate accessors for refactoring browser

Lukas Renggli
In my image only 9% of the accessors follow this pattern.

Lukas

2010/9/13 Bart Gauquie <[hidden email]>:

> don't use the type, i only uses the name of the parameter var to derive the
> name of parameter
>
> 2010/9/13 Miguel Enrique Cobá Martínez <[hidden email]>
>>
>> El lun, 13-09-2010 a las 14:02 +0200, Lukas Renggli escribió:
>> > How you derive the type?
>>
>> I think it only uses the name of the inst var to name the parameter var
>> in the accessor.
>>
>> >
>> > >From the method name? I think only very few accessors/inst-vars are
>> > named after the type.
>> >
>> > Also note that you can edit the type directly in the changes browser
>> > before you install it, that's what I typically do.
>> >
>> > Lukas
>> >
>> > 2010/9/13 Mariano Martinez Peck <[hidden email]>:
>> > > i would like that too
>> > >
>> > > On Sep 12, 2010 7:27 PM, "Bart Gauquie" <[hidden email]>
>> > > wrote:
>> > >
>> > > Dear list,
>> > >
>> > > I've noticed that when I'm using the generate accessors refactoring,
>> > > I'm
>> > > always adapting the generated code for the mutator:
>> > > number: anObject
>> > >     number := anObject
>> > > to:
>> > > number: aNumber
>> > >    number := aNumber
>> > > So I've adapted the refactoring code a bit so that it automatically
>> > > generates this correctly. Anybody also thinks this is useful? If so, I
>> > > will
>> > > create a bug/improvement and a slice for it.
>> > > Kind regards,
>> > >
>> > > Bart
>> > > _______________________________________________
>> > > Pharo-project mailing list
>> > > [hidden email]
>> > > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> > >
>> > > _______________________________________________
>> > > Pharo-project mailing list
>> > > [hidden email]
>> > > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> > >
>> >
>> >
>> >
>>
>> --
>> Miguel Cobá
>> http://miguel.leugim.com.mx
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> --
> imagination is more important than knowledge - Albert Einstein
> Logic will get you from A to B. Imagination will take you everywhere -
> Albert Einstein
> Learn from yesterday, live for today, hope for tomorrow. The important thing
> is not to stop questioning. - Albert Einstein
> The true sign of intelligence is not knowledge but imagination. - Albert
> Einstein
> However beautiful the strategy, you should occasionally look at the results.
> - Sir Winston Churchill
> It's not enough that we do our best; sometimes we have to do what's
> required. - Sir Winston Churchill
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Improving generate accessors for refactoring browser

Guillermo Polito
which pattern?  I thought we were discussing about the default... :S

I think that anObject is an ugly default, yes.  I prefere to have

>>niceSarasa: aNiceSarasa
niceSarasa := aNiceSarasa

than

>>niceSarasa: anObject
niceSarasa := anObject

Obviously, these are useful only when we autogenerate the accesors :).  If I have to modify every accesor I autogenerate, it's like not autogenerating it :).

BTW, I never use that refactor :P.

Cheers!

On Mon, Sep 13, 2010 at 11:16 AM, Lukas Renggli <[hidden email]> wrote:
In my image only 9% of the accessors follow this pattern.

Lukas

2010/9/13 Bart Gauquie <[hidden email]>:
> don't use the type, i only uses the name of the parameter var to derive the
> name of parameter
>
> 2010/9/13 Miguel Enrique Cobá Martínez <[hidden email]>
>>
>> El lun, 13-09-2010 a las 14:02 +0200, Lukas Renggli escribió:
>> > How you derive the type?
>>
>> I think it only uses the name of the inst var to name the parameter var
>> in the accessor.
>>
>> >
>> > >From the method name? I think only very few accessors/inst-vars are
>> > named after the type.
>> >
>> > Also note that you can edit the type directly in the changes browser
>> > before you install it, that's what I typically do.
>> >
>> > Lukas
>> >
>> > 2010/9/13 Mariano Martinez Peck <[hidden email]>:
>> > > i would like that too
>> > >
>> > > On Sep 12, 2010 7:27 PM, "Bart Gauquie" <[hidden email]>
>> > > wrote:
>> > >
>> > > Dear list,
>> > >
>> > > I've noticed that when I'm using the generate accessors refactoring,
>> > > I'm
>> > > always adapting the generated code for the mutator:
>> > > number: anObject
>> > >     number := anObject
>> > > to:
>> > > number: aNumber
>> > >    number := aNumber
>> > > So I've adapted the refactoring code a bit so that it automatically
>> > > generates this correctly. Anybody also thinks this is useful? If so, I
>> > > will
>> > > create a bug/improvement and a slice for it.
>> > > Kind regards,
>> > >
>> > > Bart
>> > > _______________________________________________
>> > > Pharo-project mailing list
>> > > [hidden email]
>> > > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> > >
>> > > _______________________________________________
>> > > Pharo-project mailing list
>> > > [hidden email]
>> > > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> > >
>> >
>> >
>> >
>>
>> --
>> Miguel Cobá
>> http://miguel.leugim.com.mx
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> --
> imagination is more important than knowledge - Albert Einstein
> Logic will get you from A to B. Imagination will take you everywhere -
> Albert Einstein
> Learn from yesterday, live for today, hope for tomorrow. The important thing
> is not to stop questioning. - Albert Einstein
> The true sign of intelligence is not knowledge but imagination. - Albert
> Einstein
> However beautiful the strategy, you should occasionally look at the results.
> - Sir Winston Churchill
> It's not enough that we do our best; sometimes we have to do what's
> required. - Sir Winston Churchill
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Improving generate accessors for refactoring browser

Mariano Martinez Peck
In reply to this post by Lukas Renggli


On Mon, Sep 13, 2010 at 4:16 PM, Lukas Renggli <[hidden email]> wrote:
In my image only 9% of the accessors follow this pattern.

And how many remains with anObject ???  I think it should much less than 9%

I really hate leaving this with anObject since it makes me undertand that it will be any kind of object, which usually it is on (even if it is possible).
 

Lukas

2010/9/13 Bart Gauquie <[hidden email]>:
> don't use the type, i only uses the name of the parameter var to derive the
> name of parameter
>
> 2010/9/13 Miguel Enrique Cobá Martínez <[hidden email]>
>>
>> El lun, 13-09-2010 a las 14:02 +0200, Lukas Renggli escribió:
>> > How you derive the type?
>>
>> I think it only uses the name of the inst var to name the parameter var
>> in the accessor.
>>
>> >
>> > >From the method name? I think only very few accessors/inst-vars are
>> > named after the type.
>> >
>> > Also note that you can edit the type directly in the changes browser
>> > before you install it, that's what I typically do.
>> >
>> > Lukas
>> >
>> > 2010/9/13 Mariano Martinez Peck <[hidden email]>:
>> > > i would like that too
>> > >
>> > > On Sep 12, 2010 7:27 PM, "Bart Gauquie" <[hidden email]>
>> > > wrote:
>> > >
>> > > Dear list,
>> > >
>> > > I've noticed that when I'm using the generate accessors refactoring,
>> > > I'm
>> > > always adapting the generated code for the mutator:
>> > > number: anObject
>> > >     number := anObject
>> > > to:
>> > > number: aNumber
>> > >    number := aNumber
>> > > So I've adapted the refactoring code a bit so that it automatically
>> > > generates this correctly. Anybody also thinks this is useful? If so, I
>> > > will
>> > > create a bug/improvement and a slice for it.
>> > > Kind regards,
>> > >
>> > > Bart
>> > > _______________________________________________
>> > > Pharo-project mailing list
>> > > [hidden email]
>> > > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> > >
>> > > _______________________________________________
>> > > Pharo-project mailing list
>> > > [hidden email]
>> > > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> > >
>> >
>> >
>> >
>>
>> --
>> Miguel Cobá
>> http://miguel.leugim.com.mx
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> --
> imagination is more important than knowledge - Albert Einstein
> Logic will get you from A to B. Imagination will take you everywhere -
> Albert Einstein
> Learn from yesterday, live for today, hope for tomorrow. The important thing
> is not to stop questioning. - Albert Einstein
> The true sign of intelligence is not knowledge but imagination. - Albert
> Einstein
> However beautiful the strategy, you should occasionally look at the results.
> - Sir Winston Churchill
> It's not enough that we do our best; sometimes we have to do what's
> required. - Sir Winston Churchill
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project