M
MrShovel
I'm new to this ASP.NET caper and have the following questions.
I have a TestObject that contains about 50 fields of data and 3 member
procedures. Below is a simplified explanation of what I do.
At the start of each session I initialise this TestObject.
On entering every page I create a local TestObject and do this:
TestObject = Session("TestObject")
On leaving every page I do this:
Session("TestObject") = TestObject
This way my TestObject is kept across all the pages until my user quits
or the session times out. My site will probably have up to 100
concurrent sessions running.
Question 1:
Is there a better way to do what I've just described?
-------------------------------------------------
Question 2:
Which is the better way? (Efficient)
[assuming Test=Session("TestObject")]
Test.Field1.value = "1234"
or this?
Session("TestObject").Field1.value = "1234"
Is it quicker to manipulate a local object then put it into the Session
Object when finished?
-------------------------------------------------
Question 3:
Assuming the TestObject member procedures looks something like this:
Procudure SomeProc()
me.Field1.value = "1234"
'heaps more line like above...
'heaps more line like above...
End Sub
-------------------------------------------------
Would it be better to have this?
Procudure SomeProc()
ExternalProc(Me)
End Sub
And in an another module (local on the site)
Procudure ExternalProc(ByRef Test as TestObject)
test.Field1.value = "1234"
'heaps more line like above...
'heaps more line like above...
End Sub
I'm assuming that when you transfer a sessionobject into you code it
also has to transfer all the code defined in the Object Member
Procedures, so it those procedures only have a call to an externaly
referneced module (passing a pointer to the ojbect) then there is
hardly any code in the object itself?
Am I right in this?
Thanks....
I have a TestObject that contains about 50 fields of data and 3 member
procedures. Below is a simplified explanation of what I do.
At the start of each session I initialise this TestObject.
On entering every page I create a local TestObject and do this:
TestObject = Session("TestObject")
On leaving every page I do this:
Session("TestObject") = TestObject
This way my TestObject is kept across all the pages until my user quits
or the session times out. My site will probably have up to 100
concurrent sessions running.
Question 1:
Is there a better way to do what I've just described?
-------------------------------------------------
Question 2:
Which is the better way? (Efficient)
[assuming Test=Session("TestObject")]
Test.Field1.value = "1234"
or this?
Session("TestObject").Field1.value = "1234"
Is it quicker to manipulate a local object then put it into the Session
Object when finished?
-------------------------------------------------
Question 3:
Assuming the TestObject member procedures looks something like this:
Procudure SomeProc()
me.Field1.value = "1234"
'heaps more line like above...
'heaps more line like above...
End Sub
-------------------------------------------------
Would it be better to have this?
Procudure SomeProc()
ExternalProc(Me)
End Sub
And in an another module (local on the site)
Procudure ExternalProc(ByRef Test as TestObject)
test.Field1.value = "1234"
'heaps more line like above...
'heaps more line like above...
End Sub
I'm assuming that when you transfer a sessionobject into you code it
also has to transfer all the code defined in the Object Member
Procedures, so it those procedures only have a call to an externaly
referneced module (passing a pointer to the ojbect) then there is
hardly any code in the object itself?
Am I right in this?
Thanks....