Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does inheritance help to make size of exe smaller?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01276960
Message ID:
01277000
Vues:
41
>>>>>I know that, in one way, inheritance is useful is eliminating a duplicate code. But I was wondering how much it is useful in terms of making the application .EXE smaller. Here is an example:
>>>>>Say I have a form class MyParent in one .vcx library.
>>>>>Then I create another .vcx library and store there a bunch of form classes like MyChild1, MyChild2, etc. all based on the class MyParent.
>>>>>If I didn’t have the MyParent class and simply created a bunch of form classes MyChild1, MyChild2, etc, would the size of the .EXE be much bigger?
>>>>
>>>>No,
>>>>When you build your application VFP automatically will add that class into the project.
>>>>If you hide it somehow you will not be able to compile your project.
>>>
>>>I probably didn't put my question correctly. What I meant is that instead of having forms MyChild1, MyChild2, etc. inheriting from the parent class MyParent, they will be based on the VFP base form class. That is, the second case would be not to use inheritance but to simply make each form MyChild1, MyChild2, etc. from scratch. Would this make the .exe much larger?
>>
>>I think you can easily prove the exe would be larger. Make a screen with a method with 100K of source code in it. Copy that screen 4 times, you have 500K of source. If all of that code can be in a single class, you will drop 400K of code from the project.
>
>Thank you, Mike. This is what I wanted to verify.

And Mike did not mention the maintenance nightmare when you should add a new method or property in all forms :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform