|
-
Aug 8th, 2005, 07:48 AM
#1
Thread Starter
Hyperactive Member
Remoting question
I'm thinking about writing a distributed application usng .net remoting. but i'm not sure about one thing.
The app i want to make will consist of a server and a client (surpruise surprise)
i want the server to always hold an object in memory (a dataset for example).
the client will query the server, the server will then search the dataset and the return the result.
How can the remotable object access the server apps dataset (that already exists) without creating the object.
What i mean is that for performance reasons i want the server to always hold the dataset in memory, and for the remotable object to be able to access it. but i'm not sure how it can.
I think maybe i'm thinking about this in the wrong way. but essentially what i want is:
a server that holds an object in memory and that searches that object when requested by a remote client.
-
Aug 8th, 2005, 07:57 AM
#2
Re: Remoting question
Create a "Virtual" version of this object in your client.
Example (an array, in english/pseudocode)
task 1: load basic info
client: creates the empty "virtual object" (a class which you create)
client: requests the total number of rows from the server
server: returns the rowcount
client: records this number as a property (so we can now use .length to use in for loops)
client: request record 7 (for example)
server: send data for record 7
client: use data appropriate and request next required data
client: request rowcount again to check it hasnt changed.
That would allow for your server to handle a dataset, and clients access it (without actually knowing the information in the dataset)
the key here is basically the recordcount number.
However if you are heavily requesting from the dataset it is a better idea to just transfer it over n keep it in memory on the client (unless it changes often, then the above would be the best)
-
Aug 8th, 2005, 09:19 AM
#3
Thread Starter
Hyperactive Member
Re: Remoting question
Thanks for the reply.
not sure if your approach is what i need.
I'm thinking, i think of the the folowing arrangement
client --> remote object --> server
where the client calls the remote object, which access the object (dataset for example, but it could be a tree, or whatever) on the server, and returns the result to the client.
What i'm thinking about is how to do a distbuted search. where the client may be any number of clients searching the object on the server. so the client does no processing, other than passing the search criteria, and receiving the result.
-
Aug 8th, 2005, 10:08 AM
#4
Re: Remoting question
 Originally Posted by sagey
Thanks for the reply.
not sure if your approach is what i need.
I'm thinking, i think of the the folowing arrangement
client --> remote object --> server
where the client calls the remote object, which access the object (dataset for example, but it could be a tree, or whatever) on the server, and returns the result to the client.
What i'm thinking about is how to do a distbuted search. where the client may be any number of clients searching the object on the server. so the client does no processing, other than passing the search criteria, and receiving the result.
this is the same theory as any database.
and whether search criteria is sent to manipulate the results sent back or not, makes no difference to the basics of how your program work, whether your server holds the results n releases it in segments, or in a lump sum to be temporarily stored on the clients machine.
I don't think i understand exactly what it is that you are asking?
-
Aug 8th, 2005, 10:14 AM
#5
Re: Remoting question
I don't really see a problem with what you want to do. You can do this as follows:
1. Create a class that will include a shared member variable access through a shared property - this would be your dataset and let's call the class MySharedClass.
2. Create a class that will access and search the dataset in MySharedClass - this would be the class that's accessible through remoting and let's call this MyRemotableClass.
3. Create the client that will access MyRemotableClass through remoting.
Once the server side starts, it can use MySharedClass's methods to load the dataset for use by MyRemotableClass objects. Since the shared dataset isn't a part of MyRemotableClass, it won't serialize/deserialize as part of the remoting calls (only the parts that satisfy the query criteria).
Hope this all helps,
Cheers
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|