Data in a Module

  • Thread starter Thread starter Lee Silver
  • Start date Start date
L

Lee Silver

We are in the process of converting a VB-6 DLL with about 100 classes to .NET as
part of the process of transforming a VB-6 app into an ASP app. Data that is
used by more than one of the Classes (e.g. configuration) is stored in variables
in a Module in the DLL.

Question: When more than one user is using the ASP app (and hence the DLL) at
the same time, do they have separate instances of the Module-level data or is
that shared amongst all users?

--
// Lee Silver
// Information Concepts Inc.
// http://www.information-concepts.com

Facilitating the automated conversion of Data into Information
since 1982
 
A VB.net Module is the same as a Shared Class. Everything in it is Shared.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Kevin:

Thanks for the fast response.

A VB.net Module is the same as a Shared Class. Everything in it is Shared.


I suspected that was true because I thought I remembered reading it somewhere;
but I wasn't sure what the ramifications were for an ASP app.

I guess a little re-designing is in order.
 
Hi Lee Silver ,


Thank you for using Microsoft Newsgroup Service. Based on your description,
youp're converting a set of vb6 dlls to dotnet dlls and use them in ASP.NET
web application. Also, you want to know the Module-level data in VB.NET is
shared as you put many data which will be used by several classes in the
VB.NET module? Please correct me if my understanding is not quite exact.


First, in ASP.NET, every webapplication run within AppDomain which is
smaller than a process. And Each web request from the client will be
processed in seperate thread. And the dlls(.net assembly) the web
application used are all shared in the same webapplications. For more
information on the Asp.net webapplication's runtime, you can view the tech
article throuth the following link:
http://msdn.microsoft.com/library/en-us/dnaspp/html/dngrfTheASPNETHTTPRuntim
e.asp?frame=true


As for the "Module" in VB.NET, yes, just like what Kevin said, it is the
same as a shared class, you can put some shared functions there. But in
VB.NET or C# there is no global variables, you can use the Class's static
members to provide the same function.

If you have any questions on it, please feel free to let me know.


Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Steven:

Thanks for confirming what Kevin said. Like I said to him,
a little re-design will solve the problem.
 
Back
Top