Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tool to create a superclass?
Message
De
24/12/2020 22:47:19
 
 
À
24/12/2020 13:05:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01677529
Message ID:
01677658
Vues:
75
>>>>>>Isn't that what Thor's tool "Copy for comparing..." and "Compare with copied..." are for? I remember reading your white paper recently.
>>>>>>
>>>>>>http://www.tomorrowssolutionsllc.com/Articles/Try%20Thors%20Terrific%20Tools%20Part%202.pdf
>>>>>
>>>>>They actually give the opposite of what I'm looking for, a list of differences. I want the matching PEMs and only those added at that level. Even better, I want a tool that would take the two classes as input and create the new parent class with all the common PEMs added there.
>>>>
>>>>Sounds like a nice job. How long can you wait? The classes are vcx based?
>>>
>>>If no one has a tool to recommend, I'll just get the work done, using the code I've already written to get the list.
>>>
>>Drew had a hacking tool in MaxFrame where, after you created the superclass in the normal manner, you could hack the intended subclass(es) to be children of this new parent.
>
>Thanks. That's actually the easy part. The Class Browser lets you do that. The harder part (which I've cracked) is identifying the common PEMs that have added to the two classes and adding them to the new class. I did something quick & dirty for the task I had. Now I'm trying to turn into a shareable tool with appropriate UI.

Identical EMs lifted to common ancestor: certainly. Ps I am not certain on: current code will continue to run as on init property has same start value. But sometimes Ps are meant as switches for certain behaviour, those I set at the class level even if setting found in superclass is already set the way I like: I gain the ability to introduce another ancestor and am no longer coupled to the setting found in ancestor. Can be argued both ways IMO - perhaps add a checkbox to leave certain Ps alone ? they typically are either boolean or integer (often low numbers [0..7]). No problem in shallow inheritance, but sometimes you enter an environment with deep inheritance and approaching god-class-capabilities.

For me task most often wished to automate is not identifying and moving totally identical EM, but EM (or functions) created with ^c^v and then partially overwritten, keeping identical stretches which should be broken out into common submethods IAC, which is for me reason to stay in manual mode when doing such refactoring, although I will certainly look at your tool if I find classes with common total duplicates.

But I am somewhat of a DRY nut on code smell and taste ;-)

regards
thomas
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform