Global classes

  • Thread starter Thread starter Relaxin
  • Start date Start date
R

Relaxin

I have a instance of a class that needs to be access by mutliple parts of my
application.

How do I make this instance global to my entire application?

Thanks
 
Relaxin,

When it is VBNet you can use a module (what I don't like) or a so called
shared class.

A shared class has only shared variables, properties and methods.

Something as
\\\
public class MyShared
friend shared readonly property MyName() as string
get
return "Relaxin"
end get
end Class
///

I hope this helps?

Cor
 
Hi,

You could go for:
1. a singleton class
2. a class exposing static properties
3. a static class (if you are using Whidbey)

HTH,
Rakesh Rajan
 
Back
Top