-
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?
-
-
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.
-
Hi,
Many thanks guys. Very clear now.