<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 12/7/2024 6:04 PM, Matías Waisman via Cuis-dev wrote:
<blockquote
cite="mid:CAC6m6G=bsTWoS5tJ92guVN1j5i4DAJcFafbGN=DRdedpk5tn1A@mail.gmail.com"
type="cite">
<div dir="ltr"><span
id="gmail-docs-internal-guid-67a59fe2-7fff-7463-ae07-b70b33c5e370">
<p dir="ltr" style="line-height: 1.38; margin-top: 12pt;
margin-bottom: 12pt;"><span style="font-size: 11pt;
font-family: Arial,sans-serif; color: rgb(0, 0, 0);
background-color: transparent; vertical-align: baseline;">Hello
everybody, happy Saturday!</span></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 12pt;
margin-bottom: 12pt;"><span style="font-size: 11pt;
font-family: Arial,sans-serif; color: rgb(0, 0, 0);
background-color: transparent; vertical-align: baseline;">While
using the Extract Method refactoring, I often found myself
wanting to move a newly extracted method to a different
category most times. It was quite tedious to first extract
the method and then manually create or select the target
category. Sometimes, I even forgot to move the method
altogether. I realized it would be very useful if the
"Extract Method" refactoring also allowed the user to
specify the category for the extracted method as part of
the process.</span></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 12pt;
margin-bottom: 12pt;"><span style="font-size: 11pt;
font-family: Arial,sans-serif; color: rgb(0, 0, 0);
background-color: transparent; vertical-align: baseline;">The
refactoring first prompts the user to name the method and
its parameters (as usual). Then, an additional prompt asks
the user to specify the target category for the new
method. By default, it suggests the current category where
the extraction is taking place. If the specified category
does not already exist, it will be created, and the method
will be placed inside it.</span></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 12pt;
margin-bottom: 12pt;"><span style="font-size: 11pt;
font-family: Arial,sans-serif; color: rgb(0, 0, 0);
background-color: transparent; vertical-align: baseline;">Initially,
I thought the best way to implement this feature was to
enhance the existing Extract Method refactoring by adding
the category selection functionality. However, after
telling my idea to Hernán Wilkinson, he pointed out that
it might not be ideal to force the user to click an
additional button during the process. Following his
advice, I implemented this as a new refactoring option
that coexists with the original Extract Method
refactoring.</span></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 12pt;
margin-bottom: 12pt;"><span style="font-size: 11pt;
font-family: Arial,sans-serif; color: rgb(0, 0, 0);
background-color: transparent; vertical-align: baseline;">The
new refactoring is accessible via </span><span
style="font-size: 11pt; font-family: Arial,sans-serif;
color: rgb(0, 0, 0); background-color: transparent;
font-weight: 700; vertical-align: baseline;">Cmd + L</span><span
style="font-size: 11pt; font-family: Arial,sans-serif;
color: rgb(0, 0, 0); background-color: transparent;
vertical-align: baseline;"> or from the usual refactoring
menu.</span></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 12pt;
margin-bottom: 12pt;"><span style="font-size: 11pt;
font-family: Arial,sans-serif; color: rgb(0, 0, 0);
background-color: transparent; vertical-align: baseline;">Since
much of the functionality is shared with the existing </span><span
style="font-size: 11pt; font-family: "Roboto
Mono",monospace; color: rgb(24, 128, 56);
background-color: transparent; vertical-align: baseline;">ExtractMethodApplier</span><span
style="font-size: 11pt; font-family: Arial,sans-serif;
color: rgb(0, 0, 0); background-color: transparent;
vertical-align: baseline;"> class, I made some
adjustments. Specifically, I modified </span><span
style="font-size: 11pt; font-family: "Roboto
Mono",monospace; color: rgb(24, 128, 56);
background-color: transparent; vertical-align: baseline;">requestRefactoringParameters</span><span
style="font-size: 11pt; font-family: Arial,sans-serif;
color: rgb(0, 0, 0); background-color: transparent;
vertical-align: baseline;"> and </span><span
style="font-size: 11pt; font-family: "Roboto
Mono",monospace; color: rgb(24, 128, 56);
background-color: transparent; vertical-align: baseline;">createExtractMethodNewMethodFor</span><span
style="font-size: 11pt; font-family: Arial,sans-serif;
color: rgb(0, 0, 0); background-color: transparent;
vertical-align: baseline;"> to include the category as a
parameter in the class </span><span style="color: rgb(24,
128, 56); font-family: "Roboto Mono",monospace;
font-size: 14.6667px;">ExtractMethodAndSelectCategoryApplier</span><span
style="background-color: transparent; font-size: 11pt;
font-family: Arial,sans-serif; color: rgb(0, 0, 0);
vertical-align: baseline;">. </span></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 12pt;
margin-bottom: 12pt;"><span style="background-color:
transparent; font-size: 11pt; font-family:
Arial,sans-serif; color: rgb(0, 0, 0); vertical-align:
baseline;">I also reorganized </span><span
style="background-color: transparent; font-size: 11pt;
font-family: "Roboto Mono",monospace; color:
rgb(24, 128, 56); vertical-align: baseline;">ExtractMethodApplier</span><span
style="background-color: transparent; font-size: 11pt;
font-family: Arial,sans-serif; color: rgb(0, 0, 0);
vertical-align: baseline;"> to serve as a superclass, with
two subclasses: </span><span style="background-color:
transparent; font-size: 11pt; font-family: "Roboto
Mono",monospace; color: rgb(24, 128, 56);
vertical-align: baseline;">ExtractMethodInSameCategoryApplier</span><span
style="background-color: transparent; font-size: 11pt;
font-family: Arial,sans-serif; color: rgb(0, 0, 0);
vertical-align: baseline;"> and </span><span
style="background-color: transparent; font-size: 11pt;
font-family: "Roboto Mono",monospace; color:
rgb(24, 128, 56); vertical-align: baseline;">ExtractMethodAndSelectCategoryApplier</span><span
style="background-color: transparent; font-size: 11pt;
font-family: Arial,sans-serif; color: rgb(0, 0, 0);
vertical-align: baseline;">. Each subclass defines the
specific parameters to request from the user during the
refactoring process. References to the original </span><span
style="background-color: transparent; font-size: 11pt;
font-family: "Roboto Mono",monospace; color:
rgb(24, 128, 56); vertical-align: baseline;">ExtractMethodApplier</span><span
style="background-color: transparent; font-size: 11pt;
font-family: Arial,sans-serif; color: rgb(0, 0, 0);
vertical-align: baseline;"> were updated to use </span><span
style="background-color: transparent; font-size: 11pt;
font-family: "Roboto Mono",monospace; color:
rgb(24, 128, 56); vertical-align: baseline;">ExtractMethodInSameCategoryApplier</span><span
style="background-color: transparent; font-size: 11pt;
font-family: Arial,sans-serif; color: rgb(0, 0, 0);
vertical-align: baseline;">.</span></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 12pt;
margin-bottom: 12pt;"><span style="font-size: 11pt;
font-family: Arial,sans-serif; color: rgb(0, 0, 0);
background-color: transparent; vertical-align: baseline;">Regarding
the naming of the classes, I had some doubts. An
alternative naming could rename </span><span
style="font-size: 11pt; font-family: "Roboto
Mono",monospace; color: rgb(24, 128, 56);
background-color: transparent; vertical-align: baseline;">ExtractMethodApplier</span><span
style="font-size: 11pt; font-family: Arial,sans-serif;
color: rgb(0, 0, 0); background-color: transparent;
vertical-align: baseline;"> (the superclass) to </span><span
style="font-size: 11pt; font-family: "Roboto
Mono",monospace; color: rgb(24, 128, 56);
background-color: transparent; vertical-align: baseline;">TransferCodeApplier</span><span
style="font-size: 11pt; font-family: Arial,sans-serif;
color: rgb(0, 0, 0); background-color: transparent;
vertical-align: baseline;"> and revert </span><span
style="font-size: 11pt; font-family: "Roboto
Mono",monospace; color: rgb(24, 128, 56);
background-color: transparent; vertical-align: baseline;">ExtractMethodInSameCategoryApplier</span><span
style="font-size: 11pt; font-family: Arial,sans-serif;
color: rgb(0, 0, 0); background-color: transparent;
vertical-align: baseline;"> to simply </span><span
style="font-size: 11pt; font-family: "Roboto
Mono",monospace; color: rgb(24, 128, 56);
background-color: transparent; vertical-align: baseline;">ExtractMethodApplier</span><span
style="font-size: 11pt; font-family: Arial,sans-serif;
color: rgb(0, 0, 0); background-color: transparent;
vertical-align: baseline;">. I’m open to suggestions on
this!</span></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 12pt;
margin-bottom: 12pt;"><span style="font-size: 11pt;
font-family: Arial,sans-serif; color: rgb(0, 0, 0);
background-color: transparent; vertical-align: baseline;">Any
feedback or comments are appreciated, below is the change
set. </span></p>
</span><br class="gmail-Apple-interchange-newline">
</div>
</blockquote>
<br>
Hi Matías,<br>
<br>
Smalltalk and Cuis encourage appropriating the system to suit your
needs.<br>
<br>
But the main distribution of Cuis needs to keep a balance between
personal preferences of users and overall system complexity.
Otherwise Cuis would become the (theoretical set) union of all their
users preferences, and this doesn't scale.<br>
<br>
I suggest keeping this separated from the standard Cuis image,
either as a package file or as a change set.<br>
<br>
Thanks,<br>
<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich</pre>
</body>
</html>