Chapter 21 - Distributed Applications with .NET Remoting | |
bySimon Robinsonet al. | |
Wrox Press 2002 | |
In this chapter we've seen that .NET Remoting can make the task of invoking methods across the network straightforward. A remote object just has to inherit form MarshalByRefObject . In the server application only a single method is needed to load the configuration file so that the channels and remote objects are both set up and running. Within the client, we load the configuration file and can use the new operator to instantiate the remote object.
We also used .NET Remoting without the help of configuration files. On the server, we simply created a channel and registered a remote object. On the client, we created a channel and used the remote object.
We have seen in this chapter that although .NET Remoting can be that straightforward, the architecture is also flexible and can be extended. All parts of this technology such as channels, proxies, formatters, message sinks, and so on, are pluggable and can be replaced with custom implementations .
We used HTTP and TCP channels for the communication across the network, and SOAP and binary formatters to format the parameters before sending.
We discussed the use of stateless and stateful object types that are used by well-known and client-activated objects. With client-activated objects we have seen how the leasing mechanism is used to specify the lifetime of remote objects.
We have also seen that .NET Remoting is very well integrated in other parts of the .NET Framework, such as calling asynchronous methods, performing callbacks using the delegate and event keywords, among others.
Now, let's build on this experience by exploring Windows Services in our next chapter.