Solved

Modules in VB.NET

Posted on 2003-12-08
3
529 Views
Last Modified: 2007-12-19
Hi,

Just wondering if someone could explain to me the usage of Modules in VB.NET, and why one would chose to use this method.  

According to a book's definition, programmers use modules to group related rpcedures so that they can be reused in other projects.  Modules are similar in many ways to classes; they allow programmers to build reusable components without a full knowledge of object-oriented programming.  

So if this was the case, why not just use regular classes in VB.NET, and inherit the base class?  Or is this a feature that was carried over from the VB6 days of coding?  

Thanks,
scottiesi
0
Comment
Question by:scottiesi
3 Comments
 
LVL 1

Expert Comment

by:Crazy_king_in
ID: 9902872
It is a feature from VB6 and further more a class can be declared in a module.
This module is for re-usability and not just for inheritance.
0
 
LVL 10

Accepted Solution

by:
GoodJun earned 50 total points
ID: 9904113
a module is a class (a special class). You don't have to use it, it only provides some convenience for the vb6 programmers that used to it. The procedures in the module is in a global class that you don't need to instantiate by yourself. The CLR will know to search this global object (after it is instantiated automatically) to find the procedures when you use it.
0
 
LVL 8

Expert Comment

by:Dranizz
ID: 9906371
In VB.NET the module is equivalent as making a Static Class with Shared Methods
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question