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. 8 1107
* "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>
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>
* "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>
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" <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
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
"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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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:
|
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...
|
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...
|
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...
|
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...
|
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...
|
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
|
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...
|
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"...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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: 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,...
|
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...
|
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...
|
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,...
| |