473,508 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using AJAX when class instances get disposed after load

PJ6
AJAX is great, but in order to reference specific class instances
server-side, I have to maintain a static function to return them from a
unique identifier. Only... the consumer controls themselves get disposed
after the page loads! The object(s) I'm concerned with are not controls
themselves, but now I'm faced with trying to decide when to dispose them
without being able to pay attention to disposal of the consumers.

I suppose I could persist a single instance of each kind of class instanace
in memory, but I'm worried that I'd then have to make all of them
thread-safe.

I'm sure I'm not the first person to run across this problem. Any
sugestions?

TIA,
Paul
Dec 5 '05 #1
3 953
You could use Atlas. It allows you to dynamically access web services
via ECMAScript (JavaScript). Since you are using a system with
explicit components, you should probably be tapping into the SOA world.
Using a SOA approach, you don't rely on controls, but components
(services in this case).

Doing a poor-mans cache (static object) is another way to get things
done. I'll never recommend Application[] persistence due to it's
limitations though.

You may also want to look at my Png64 Server example on my blog below
(Firefox only). It's an example of how you can use remote scripting
(what is being called Ajax now adays) to access a remote page in a SOA
fashion without atlas and without web services. The server is just an
aspx page throwing back XML. The browser (modern browsers as well as
IE can do this) then parses the XML and you get your data.

David
http://www.davidbetz.net/dynamicbliss/
http://www.davidbetz.net/winfx/

Dec 5 '05 #2
ajax doesn't change the request/response nature of websites. it just browser
client code making a server call (which should be stateless), and using
dhtml to display results.

-- bruce (sqlwork.com)

"PJ6" <no****@nowhere.net> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
AJAX is great, but in order to reference specific class instances
server-side, I have to maintain a static function to return them from a
unique identifier. Only... the consumer controls themselves get disposed
after the page loads! The object(s) I'm concerned with are not controls
themselves, but now I'm faced with trying to decide when to dispose them
without being able to pay attention to disposal of the consumers.

I suppose I could persist a single instance of each kind of class
instanace in memory, but I'm worried that I'd then have to make all of
them thread-safe.

I'm sure I'm not the first person to run across this problem. Any
sugestions?

TIA,
Paul

Dec 6 '05 #3
PJ6
Hmmm. Maybe I should back up a bit before I make this too complicated.
You're right, the server calls should be stateless. That means that the DB
updating mechanism I'm using should be as well if I'm doing remote
scripting. Time to tweak the design a bit...

The simplest design does not persist data in consumer objects but rather
just recreates them every time an updating call is made. I don't like this
because technically I could use a chaching mechanism. But I can put that in
later. "Never optimize a prototype".

Guess that solves my problem with multithreading... I'll just avoid any
design that requires it.

Thanks,
Paul

"Bruce Barker" <br******************@safeco.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
ajax doesn't change the request/response nature of websites. it just
browser client code making a server call (which should be stateless), and
using dhtml to display results.

-- bruce (sqlwork.com)

Dec 6 '05 #4

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

Similar topics

3
1165
by: dast | last post by:
Hi, I'm using a delegate to edit some controls on formA from another thread on formB. This works nicely the first time I run formA. But if I close formA and reopen it I get errors. When...
8
10388
by: Marc Gravell | last post by:
I want to write a method that will accept a stream as a parameter, and which will write xml to the stream (based in reality on database results) using the XmlTextWriter class. However, this insists...
1
1825
by: vachacz | last post by:
hi i'm struggling with integration of a js class aimed for ajax handling with fireing actions from the class. here's my code sample: function AjaxLibLoad(httpActionParam, targetLayerParam){...
10
1929
by: mg | last post by:
I'm migrating from VB6 and have a question about using 'Using' and the best way to use it. Here is a example of a small bit of code: dbConx("open") Using CN Dim CMD As New OleDbCommand(sSQL,...
53
4596
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
7
4702
by: garyusenet | last post by:
This is the first time i've worked with openfile dialog. I'm getting a couple of errors with my very basic code. Can someone point out the errors in what i've done please....
7
1783
by: =?Utf-8?B?RnJhbnM=?= | last post by:
Hi, I'm working on an application where it is essential to free underlying non-memory resources as soon as they are no longer needed. In my case, it is a VISA resource which is used in automated...
1
2858
by: bsprogs | last post by:
I am currnetly programming a file hosting website in PHP and I am slowly integrating AJAX into the website. Here is my problem: The user uploads the file. The server processes the file and...
1
3583
by: soms2m | last post by:
HELLO ALL, I want to fill the parent window height with respect to the sub window height which is loading using ajax (mootools). For example if the parent window height is normal and the loading...
0
7127
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...
0
7391
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7054
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
7501
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
5633
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
424
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.