473,382 Members | 1,329 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,382 software developers and data experts.

Writing .NET Classes

Jen
I am fairly new to .NET and was wondering if someone
could point me to a tutorial/overview of writing custom
classes? Thank you.
Nov 19 '05 #1
5 1050
Here's a custom class:

public class foo
{
public foo()
{
}
}

What else do you need to know?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Jen" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
I am fairly new to .NET and was wondering if someone
could point me to a tutorial/overview of writing custom
classes? Thank you.

Nov 19 '05 #2
Jen
Well, I guess a little more background than that. Why
would you choose to use them? How they are integrated?
Differences between modules? etc...
-----Original Message-----
Here's a custom class:

public class foo
{
public foo()
{
}
}

What else do you need to know?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Jen" <an*******@discussions.microsoft.com> wrote in messagenews:05****************************@phx.gbl...
I am fairly new to .NET and was wondering if someone
could point me to a tutorial/overview of writing custom
classes? Thank you.

.

Nov 19 '05 #3
Jen,
Modules in VB.Net are just a nice/simple way to do something else: create a
utility class. When you do:

Module Foo
public function DoSomething() as string
...
end function
end Module

it actually gets compiled as a class:

CLASS Foo
PRIVATE SUB NEW
END SUB

public SHARED function DoSomething() as string
...
end function
end CLASS

I've capitalized the difference between the two. It might even mark the
class as NotInheritable (I'm not sure, though it should), but that's really
beyond the point. What I'm trying to say is that a module is a
class...atleast a static/shared class. If you prefer to use one syntax over
another, I see little harm in that (though it might confuse C#/Java
programmers). The difference between the type of class a Module creates (a
static/shared class) and a normal "instance" class is that you never create
an instance of a module.

You would never do:

Dim myFoo as Foo = new Foo()

actually, you can't do this....you would only use it for utility purposes:

dim someValue as string = Foo.DoSomething()

whereas a normal class you create an instance:

dim user as User = new User()
user.UserId = 1
user.UserName = "asdas"
.....
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Jen" <an*******@discussions.microsoft.com> wrote in message
news:16****************************@phx.gbl...
Well, I guess a little more background than that. Why
would you choose to use them? How they are integrated?
Differences between modules? etc...
-----Original Message-----
Here's a custom class:

public class foo
{
public foo()
{
}
}

What else do you need to know?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Jen" <an*******@discussions.microsoft.com> wrote in

message
news:05****************************@phx.gbl...
I am fairly new to .NET and was wondering if someone
could point me to a tutorial/overview of writing custom
classes? Thank you.

.

Nov 19 '05 #4
Try :
http://msdn.microsoft.com/library/de...ript_start.asp

You'll find the reference for Visual Basic .NET, C#, Managed C++ and JScript
..NET

Patrice

--

"Jen" <an*******@discussions.microsoft.com> a écrit dans le message de
news:16****************************@phx.gbl...
Well, I guess a little more background than that. Why
would you choose to use them? How they are integrated?
Differences between modules? etc...
-----Original Message-----
Here's a custom class:

public class foo
{
public foo()
{
}
}

What else do you need to know?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Jen" <an*******@discussions.microsoft.com> wrote in

message
news:05****************************@phx.gbl...
I am fairly new to .NET and was wondering if someone
could point me to a tutorial/overview of writing custom
classes? Thank you.

.

Nov 19 '05 #5
> Why
would you choose to use them?
Everything in .Net is an object (class). So, you would use them when you
need a class that doesn't exist in the CLR.
How they are integrated?
I'm not sure what you mean by that. Integrated with what?
Differences between modules?
Karl covered that in his reply.

You might benefit from the .Net SDK, which is a free download:

http://www.microsoft.com/downloads/d...displaylang=en

It has lots of articles, tutorials, and sample code in it, as well as a
complete reference to the CLR.
--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Jen" <an*******@discussions.microsoft.com> wrote in message
news:16****************************@phx.gbl... Well, I guess a little more background than that. Why
would you choose to use them? How they are integrated?
Differences between modules? etc...
-----Original Message-----
Here's a custom class:

public class foo
{
public foo()
{
}
}

What else do you need to know?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Jen" <an*******@discussions.microsoft.com> wrote in

message
news:05****************************@phx.gbl...
I am fairly new to .NET and was wondering if someone
could point me to a tutorial/overview of writing custom
classes? Thank you.

.

Nov 19 '05 #6

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

Similar topics

11
by: lawrence | last post by:
I asked a lot of questions in May about how to organize OO code. I didn't get great answers here, but someone here suggested that I look the Eclipse library, which was a good tip. Looking at its...
6
by: Jeff Thies | last post by:
I've been thinking about writing CSS that's easy to read and adjust at a later date (often by someone else). Here's where I seem to be headed: Breaking the page down into container divs,...
2
by: Mitch | last post by:
Hi all, I hope this is the right place for this post, apologies if it is not. I am trying to write a program that creates an input file for a dispersion model. The model is expecting a Fortran...
0
by: sedefo | last post by:
I ran into this Microsoft Patterns & Practices Enterprise Library while i was researching how i can write a database independent data access layer. In my company we already use Data Access...
4
by: aaronfude | last post by:
Hi, Perhaps this is slightly offtopic. Coming into the Windows world from Unix. Is there a reference on writing C++ libraries in a portable way. For example, right now I'm sticking...
4
by: Gary Bond | last post by:
Hi All, Can anybody point me to some 'how-to' documentation, tutorials, etc as to how to write a shrink/protect wrapper for .Net exes/dlls, (like the Shrinkwrap product for instance). I have...
24
by: ypjofficial | last post by:
Hello all, I have written a class with many private data members.and i am putting it in a separate dll file. Now when i link that file while writing my main program module,natuarally i have to...
9
by: bonk | last post by:
Does anyone have a simple example on how to prohibit that any thread other than the current thread modifies a certain object (a collection) while we are in a certain section of the code? In other...
9
by: jerry.upstatenyguy | last post by:
I am really stuck on this. I am trying to write a string array containing a "word" and a "definition" to a class called Entry. Ultimately this will end up in another class called dictionary. No,...
6
by: Mizipzor | last post by:
Hi, this is my first mail to the list (and any list for that matter) so any pointers on errors from my part would be appreciated. Im more used to forums. To start off, Ive read some python...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.