Solved

Modules in VB.NET

Posted on 2003-12-08
3
525 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
Comment Utility
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
Comment Utility
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
Comment Utility
In VB.NET the module is equivalent as making a Static Class with Shared Methods
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

744 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

13 Experts available now in Live!

Get 1:1 Help Now