473,385 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Modules versus classes with shared methods?

Is there any disadvantage to using a class with shared methods as
opposed to a module? I suppose the end result is the same, but I'm
curious about any other issues.

Regards,

Chris
Nov 20 '05 #1
4 4357
The only difference I have seen is, I find it easier to work with classes,
and unless you want to call

MyClass.MySharedMethod

instead of amodules where you just call

MySharedMethod

Which you can do with a class with

imports MyClass

at the top... I see no real difference though... At elast for what I need.

"Chris Ashley" <ch**********@blueyonder.co.uk> wrote in message
news:bl************@ID-96489.news.uni-berlin.de...
Is there any disadvantage to using a class with shared methods as
opposed to a module? I suppose the end result is the same, but I'm
curious about any other issues.

Regards,

Chris

Nov 20 '05 #2
"Chris Ashley" <ch**********@blueyonder.co.uk> schrieb
Is there any disadvantage to using a class with shared methods as
opposed to a module? I suppose the end result is the same, but I'm
curious about any other issues.


Two things you don't have to do with Modules:
- Write "Shared" in front of every member
- Import the class at project level

The result is the same.
--
Armin

Nov 20 '05 #3
Classes allow you to have Private and Protected variables as well as the
ability to use inheritance. Modules don't really.

I only use modules for what I like to call utility functions.. functions
that are totally object independent that do useful routines and don't really
handle important information..

If you are modelling objects then use classes in my opinion...that's what
they are there for ;)

All the best,

Jon

"Chris Ashley" <ch**********@blueyonder.co.uk> wrote in message
news:bl************@ID-96489.news.uni-berlin.de...
Is there any disadvantage to using a class with shared methods as
opposed to a module? I suppose the end result is the same, but I'm
curious about any other issues.

Regards,

Chris

Nov 20 '05 #4
On 2003-09-26, Chris Ashley <ch**********@blueyonder.co.uk> wrote:
Is there any disadvantage to using a class with shared methods as
opposed to a module? I suppose the end result is the same, but I'm
curious about any other issues.

Regards,

Chris


In fact, at the IL level there is no difference. A module is converted
by the VB.NET compiler into a sealed class with all shared methods. The
difference is mostly about style. Personally, I would use a class with
shared methods rather then a module - but that's me.

Tom Shelton
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jorgen Grahn | last post by:
I have a set of tests in different modules: test_foo.py, test_bar.py and so on. All of these use the simplest possible internal layout: a number of classes containing test*() methods, and the good...
4
by: Chuck Ritzke | last post by:
I keep asking myself this question as I write class modules. What's the best/smartest/most efficient way to send a large object back and forth to a class module? For example, say I have a data...
5
by: Erik Cruz | last post by:
Hello! I have read some threads discussing the fact that a module is in reality a shared class. If I try to create a Public Shared Class in vb.net I receive a compile error. Why? If I can't...
49
by: Emmett | last post by:
I am working with a .NET development team and I am looking for reasons, that I can present to management, as to why we should develop our software using C# rather than VB.NET.
173
by: Zytan | last post by:
I've read the docs on this, but one thing was left unclear. It seems as though a Module does not have to be fully qualified. Is this the case? I have source that apparently shows this. Are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.