Results 1 to 4 of 4

Thread: Modules (Resolved)

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Modules (Resolved)

    Hi,

    I've just seen the following in a post on another forum.

    "Now, I will say this. Stay away from modules in VB .NET. They are basically equivalent to public shared members in properly designed class. My feeling is that you should just use properly designed classes rather than lean on module because it forces you to "think correctly" and not borrow from some of the VB baggage that still caries over to the .NET arena. "


    Any views anyone, please?
    Last edited by taxes; Nov 22nd, 2004 at 06:51 AM.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well its entirely true - a module is simply a class with public shared members. In VB 6 etc., a module could contain code etc. that was available anywhere throughout your application.
    But with VB.NET, you're basically using the equivalent of a Class Module.

    But. Having said that, if you have a number of methods that are of use to various other methods in your application - where else are you going to put them?
    If you're being totally strict and enforcing OO rules, then I suppose you should have the methods in some class and perhaps inherit from that to access them.
    Who knows, who cares.

    Just use modules - its easier, and there's nothing necessarily bad about them either.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    Many thanks guys. Very clear now.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width