Remoting architecture and serialization

P

Padu

Hi,

I'm designing a system in C# and I believe the .net framework will simplify
my task. Let me give you a background of my app first:

Client:
Has a collection of certain objects called "Command". Commands may be saved
(serialized) to a local disk, loaded later and then sent to a host for
execution.
Must realize if server is on before sending the "script of Command"

Server:
Receives commands from clients (usually only one client)


I'm leaning towards using serialization and/or remoting to design this app.
Network security is not a concern. From what I've read so far, I believe I
could design this system in the following way:

Mark the client "Command" as [Serializable] and use a binary formatter to
serialize/deserialize from disk.
Use remoting for "Command" transmission. The server has a CommandProcessor
object which inherits from MarshalByRefObject. One of its methods
(ProcessCommand) receives a Command, so basically my client app would use
the following line of code to send a command to the server:

commandProcessor.ProcessCommand(clientCommand);

Both apps are windows form apps. Later I will need to receive data from the
server as either events or callbacks, but that's later.


Do you the way I am trying to do makes sense? Well, I'll find out when I
start implementing it, but if you know that it won't work, it will save me
some work.

Cheers

Padu
 
N

Nicholas Paldino [.NET/C# MVP]

Padu,

Given that you don't have a requirement for network security, as well as
the fact that the Command objects are already serializable, I think remoting
is a good solution here.

Just make sure that you have the assemblies with all the serialized
types loaded on the server side.
 
P

Padu

I'll try that then... I'll just have to learn a bit more about assemblies.

Cheers

Padu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top