group of imports statements

  • Thread starter Thread starter John A Grandy
  • Start date Start date
J

John A Grandy

what are the various alternatives to including a group of imports statements
in every module ?

imports <namespace1.class1>
imports <namespace2.class1>
imports <namespace2.class2>
etc.
 
John A Grandy said:
what are the various alternatives to including a group of imports
statements in every module ?

imports <namespace1.class1>
imports <namespace2.class1>
imports <namespace2.class2>
etc.


Alternatives?

http://msdn.microsoft.com/library/en-us/vbls7/html/vblrfVBSpec5_2.asp

You can also add the imports in the project properties. (general ->
imports)

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
* "John A Grandy said:
what are the various alternatives to including a group of imports statements
in every module ?

imports <namespace1.class1>
imports <namespace2.class1>
imports <namespace2.class2>
etc.

A project import. Go to the project properties window -> "General
Properties" -> "Imports" and add your imports there. But why do you
want to import classes?
 
what kind of classes?

let's generalize and say that, practically speaking, there are two kinds of
classes:
1. classes that hold data
2. classes that don't

so, instances of cat 1 classes differentiate themselves based on specific
data values held

for cat 2 classes, if instantiation is a mere formality, why bother with it?

you can extend this generalization to include in cat 2 those classes with
only a few initialization parameters. (they don't truly hold data, at least
not db io data)
 
Hi Herfried,

Can be useful, I did it to the System.Convert class once, when a code file
had excessive need to use the shared methods within.

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
 
* "Tom Spink said:
Can be useful, I did it to the System.Convert class once, when a code file
had excessive need to use the shared methods within.

Right -- I use it too for shared methods of "uitility" classes.
 
why limit it to shared methods of .net framework classes?

i do imports of all sorts of custom classes i write. as long as you
carefully choose your method names to be (1) distinct from anything .net
offers, and (2) properly indicative of what the method actually does, then
you save a lot of typing and characters on the page. also, less lines
extending off the page (or need to break the lines with line-continuation
characters). it all adds up to more readable code.

anything that can reduce code-bloat is good, in my opinion
 
John A Grandy said:
why limit it to shared methods of .net framework classes?

i do imports of all sorts of custom classes i write. as long as
you carefully choose your method names to be (1) distinct from
anything .net offers, and (2) properly indicative of what the method
actually does, then you save a lot of typing and characters on the
page. also, less lines extending off the page (or need to break the
lines with line-continuation characters). it all adds up to more
readable code.

anything that can reduce code-bloat is good, in my opinion

I don't agree. Classes are there /not/ to be forced to find "globally"
unique names, and you get a better structured code. If you put it all in one
pot again would put this concept upside down (IMO) (and as usual there are
exceptions from the rule).


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
John A Grandy said:
what kind of classes?

let's generalize and say that, practically speaking, there are two
kinds of classes:
1. classes that hold data
2. classes that don't

so, instances of cat 1 classes differentiate themselves based on
specific data values held

for cat 2 classes, if instantiation is a mere formality, why bother
with it?

you can extend this generalization to include in cat 2 those classes
with only a few initialization parameters. (they don't truly hold
data, at least not db io data)

I was not talking about instantiation and initialization, so I don't see the
point.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
Back
Top