473,503 Members | 2,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Facing hard work ahead..

Hi,

I have used Shared functions for Connection, User, and Setup variables in my
application.
That works well for the client app, but when I was now accessing my
functions via ASP.NET of course I ran into trouble (shared is shared over
the whole application, not only a session)

So, To re-write my app to handle a local reference of the objects above, its
a "little" work (100 forms, several hundred classes)

Well If I need to, Its 6 hours hard work and its done, but what is the best
way to do it?

The diffrent approaches I see is:

First, Merge the three object into one class, call it SystemData or
whatever.

Then I can either:

Create a local variable, and on each class and form use New() to pass my
information.

Or

Create a new Base Class and Base Form that all other inherits from, in that
base, create a local protected variable and use New() to set it.

Does anybody have a better idea?
If not, which of the above is the best way to do it?

Regards
Fredrik Melin
Nov 20 '05 #1
2 948
Fredrik,
I would consider making Connection, User, and Setup shared properties
instead of variables.

Then make the bodies of the properties reference the Session object instead
of an actual shared variable.

Something like:

Public Shared Property Connection As Object
Get
Return Session("connection")
End Get
Set(ByVal value As Object)
Session("connection") = value
End Set
End Property

Of course you would use the actual type for the Connection property instead
of Object.

This allows your code to continue using Whatever.Connection without needing
to be modified.

Hope this helps
Jay

"Fredrik Melin" <me*@n.o.spam.dacsa.net.remove.as.needed> wrote in message
news:AY********************@giganews.com...
Hi,

I have used Shared functions for Connection, User, and Setup variables in my application.
That works well for the client app, but when I was now accessing my
functions via ASP.NET of course I ran into trouble (shared is shared over
the whole application, not only a session)

So, To re-write my app to handle a local reference of the objects above, its a "little" work (100 forms, several hundred classes)

Well If I need to, Its 6 hours hard work and its done, but what is the best way to do it?

The diffrent approaches I see is:

First, Merge the three object into one class, call it SystemData or
whatever.

Then I can either:

Create a local variable, and on each class and form use New() to pass my
information.

Or

Create a new Base Class and Base Form that all other inherits from, in that base, create a local protected variable and use New() to set it.

Does anybody have a better idea?
If not, which of the above is the best way to do it?

Regards
Fredrik Melin

Nov 20 '05 #2
Hi,

Hmm, I think I described it a little poorly
(or I dont understand your solution)

The classes that I am talking about, isnt web-based by default, they are
build for a Windows form applicaton (that works well with shared variables)
For the WEB part, I compile those classes into a "Support dll (assembly)"
that is a separate solution with physical files linked from the windows form
solution.

So the web programmer, do only reference my support dll and he has all
functionallity that exists in the Windows Form application.

So only way the Support dll can interact with sessions is if the user sends
data into it before calling a function.

The problem is then If I Store the data in a shared variable inside the
support dll, it will be shared between all users using the ASP application.

Regards
Fredrik

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:ee*************@TK2MSFTNGP11.phx.gbl...
Fredrik,
I would consider making Connection, User, and Setup shared properties
instead of variables.

Then make the bodies of the properties reference the Session object instead of an actual shared variable.

Something like:

Public Shared Property Connection As Object
Get
Return Session("connection")
End Get
Set(ByVal value As Object)
Session("connection") = value
End Set
End Property

Of course you would use the actual type for the Connection property instead of Object.

This allows your code to continue using Whatever.Connection without needing to be modified.

Hope this helps
Jay

"Fredrik Melin" <me*@n.o.spam.dacsa.net.remove.as.needed> wrote in message
news:AY********************@giganews.com...
Hi,

I have used Shared functions for Connection, User, and Setup variables in
my
application.
That works well for the client app, but when I was now accessing my
functions via ASP.NET of course I ran into trouble (shared is shared

over the whole application, not only a session)

So, To re-write my app to handle a local reference of the objects above,

its
a "little" work (100 forms, several hundred classes)

Well If I need to, Its 6 hours hard work and its done, but what is the

best
way to do it?

The diffrent approaches I see is:

First, Merge the three object into one class, call it SystemData or
whatever.

Then I can either:

Create a local variable, and on each class and form use New() to pass my
information.

Or

Create a new Base Class and Base Form that all other inherits from, in

that
base, create a local protected variable and use New() to set it.

Does anybody have a better idea?
If not, which of the above is the best way to do it?

Regards
Fredrik Melin


Nov 20 '05 #3

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

Similar topics

0
1855
by: John | last post by:
Internet Facing SQL Server, Login Security? How? I would think that our Project is fairly common. We're stuck on a security question. We have a typical SQL Server 2000, running under Windows...
7
2199
by: dixie | last post by:
I have been running some code from a form's on open event to run regedit if a registry key does not exist in the registry. It has been working fine, but I have had the path to the registry fix...
11
1693
by: Peter Oliphant | last post by:
I've been trying all morning to convert my 2003 project (managed) to 2005 (/clr since I have both managed and unmanaged code). I'm guessing I have tens of thousands of lines of code to change. Did...
2
875
by: suresh chowdary | last post by:
In internet explored my Asp.Net proect is working properly. but the same is not working in Netscape. Tell me any solution please *** Sent via Developersdex http://www.developersdex.com ***...
10
2814
by: Brett | last post by:
If I have many hard coded values such as file paths, file names, timeouts, etc, where is the best place to define them? Meaning, in the case something needs changing for example, rather than...
12
5108
by: Joel Byrd | last post by:
I'm having a little problem with using type-ahead functionality for an auto-suggest box. Sometimes, when I start to type something and the type-ahead shows up, the AJAX will send a request query...
8
8519
by: dantan98 | last post by:
Hello all... Please don't ask me why, but I am currently tasked to somehow discover when the hard drive is being accessed (for reads and writes). All of the searching I have done has been...
14
28077
by: Lauren Wilson | last post by:
Discovered this interesting comment on MSDN: "To programmatically obtain the hard disk's serial number that the manufacturer assigns, use the Windows Management Instrumentation (WMI)...
2
4657
by: rakesh kumawat | last post by:
I am facing a problem while reading the result which is loaded in DOMDocument. In which I am sending a request to web service and getting a record of Single Order. This is my VB Code which is i am...
0
7205
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
7093
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...
1
7008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7467
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
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
399
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.