Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Classes vs Standard Modules
Message
De
13/03/2003 14:27:34
 
 
À
13/03/2003 11:38:51
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00765424
Message ID:
00765525
Vues:
18
Advantages:

  • Encapsulation: By grouping functionalities by class, it is easier to read, to use and to maintain. Also, by encapsulating properties (variables) in classes, you can control their uses
  • Polymorphism: One functionality can be shared by many class. For example, many class can implement the method Save, you don't have to create a different name for each class as you have to do in modules
  • Information hiding: You make visible to the outside world only the properties and methods (interface) that need to be made public
  • Portability: Will be easier to port to .NET, if the need arise, since .NET is all about OOP

    Disadvantages:

  • Effort and cost: May need a major rewrite of the current application
  • Learning curve: For learning OOP concept
  • Memory use: May in fact require more memory. Unless the application is running on thight memory machine and/or need lots of them, this should not be a major issue, since the object overhead is not very significant. If it is a major issue, then the choice of tool may not have been the right one

    You can convert you modules in classes incrementaly, start with one class and regroup all the properties and methods that the class need under it. Then do the same thing with other classes until most or all of the functions have been treated. You can then break the classes in smaller pieces if needed.

    Is it worth the effort? You know the application more than I, so you're in a better position to take position on this. I would however strongly consider porting the application to .NET considering the effort that may be needed to port all modules in classes.

    HTH

    >I have an application written using roughly 8 standard modules, and no class modules. The standard modules all together include a total of around 4000 different sub routines. I was thinking of breaking some of the sub routines out of the standard modules and making them classes. Are there any advantages or disadvantages to doing this? Or is it event worth the effort of doing this?
    >
    >Specifically, will it cause the app to use less memory at runtime?
  • Précédent
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform