all groups > macromedia flash flash remoting > january 2004 >
You're in the

macromedia flash flash remoting

group:

Gateway class constructor, EVERYTIME!


Gateway class constructor, EVERYTIME! bjc160
1/31/2004 1:40:13 AM
macromedia flash flash remoting: Is there a way to keep the .net gateway controller from constructing my class everytime there is a method call? I am constructing a large XML doc in the constructor, and building it everytime a session calls for a small part is killing my server! Let me know if you need code, I can't find anything that talks about this, and the flashgateway classes are giving me no hints..

~The Chef

Re: Gateway class constructor, EVERYTIME! Joshua Sanderson
2/9/2004 10:03:18 AM
I think you're asking if you can call a non-default constructor on the
server-side with Flash Remoting. Not that I know.

Regarding your problem, can you change the design of your classes? For
instance, declare your large XML doc as a static member on the server-side
class, and create it once in the ASP.NET global.aspx Application_Start
event?

When the Remoting .NET Gateway contructs your class with the default
constructor, your static XML doc field will already exist. Lots of other
patterns availabe for this problem too, (like Singleton), but I think this
would be the easiest.

Just a thought.

- josh


[quoted text, click to view]
class everytime there is a method call? I am constructing a large XML doc
in the constructor, and building it everytime a session calls for a small
part is killing my server! Let me know if you need code, I can't find
anything that talks about this, and the flashgateway classes are giving me
no hints..
[quoted text, click to view]

AddThis Social Bookmark Button