Solved

Modules in VB.NET

Posted on 2003-12-08
3
527 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Code works but it's slow 28 70
Need help making a program or form for inventory that exports to txt 8 39
start a process from a service 3 21
Store results in vb.net 3 20
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…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now