|
-
Nov 22nd, 2004, 06:07 AM
#1
Thread Starter
PowerPoster
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.
-
Nov 22nd, 2004, 06:17 AM
#2
-
Nov 22nd, 2004, 06:19 AM
#3
Retired VBF Adm1nistrator
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]
-
Nov 22nd, 2004, 06:50 AM
#4
Thread Starter
PowerPoster
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|