473,398 Members | 2,389 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,398 software developers and data experts.

group of imports statements

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.
Nov 20 '05 #1
8 1107
"John A Grandy" <johnagrandy-at-yahoo-dot-com> schrieb
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...fVBSpec5_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

Nov 20 '05 #2
* "John A Grandy" <johnagrandy-at-yahoo-dot-com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
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
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ON**************@TK2MSFTNGP12.phx.gbl...
* "John A Grandy" <johnagrandy-at-yahoo-dot-com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #4
* "Tom Spink" <thomasdotspinkat@ntlworlddotcom> scripsit:
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.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
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

Nov 20 '05 #6
"John A Grandy" <johnagrandy-at-yahoo-dot-com> schrieb
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

Nov 20 '05 #7
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)

"Armin Zingler" <az*******@freenet.de> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
"John A Grandy" <johnagrandy-at-yahoo-dot-com> schrieb
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

Nov 20 '05 #8
"John A Grandy" <johnagrandy-at-yahoo.com> schrieb
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

Nov 20 '05 #9

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

Similar topics

2
by: David Lozzi | last post by:
I'm trying to do this: <%@ Page Language="VB" %> <script runat="server"> Imports System.Data Imports System.Data.SqlClient But i get this error on line 4:
3
by: | last post by:
I'm picking up an 'IMPORTS' error for a simple database insert based on two input entry boxes in my form? It says an 'Imports' statement must preceede any declarations....... is this perahps the...
3
by: Chad Beckner | last post by:
I am starting to translate some code from ASP to ASP.NET (VB). I was able to query ADS to get a users groups that they belong to, and also query a group and get a list of users. However, I can't...
2
by: david | last post by:
When I declared the imports statements as follows Imports System.Runtime.Remoting Imports System.Runtime.Remoting.Channels Imports System.Runtime.Remoting.Channels.Tcp Imports...
19
by: Tiraman | last post by:
Hi , I have an assembly that hold few class and few imports which are not used in all of the class's . so my question is when to use the "Imports XXX" And when to use this kind of statement...
3
by: Howard Kaikow | last post by:
I was doing some testing of the effect of Option Strict on particular Word VBA statements. So I created a Form, the events of which called Subs in separate Modules. Each Module is in a separate...
7
by: pcnerd | last post by:
In Java I can use, for example, " Imports java.util.* ". Can I use, for example, " Imports System.* " instead of several different "Imports" statements? Thank you. David
7
by: Mike | last post by:
I am trying to create a small admin toolset using visual studio 2005 (vb). I want to be able to supply a domain username and have it add to the local workstation Remote desktop user's group. This...
5
by: kimiraikkonen | last post by:
Hello, I want to ask about "imports" statement. Some projects must be inserted with "imports xxxx" statements before beginning coding. But how do i know when to use or do i have to use "imports"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.