The .NET Framework provides a platform for building next-generation distributed applications. I'll start this chapter by introducing distributed applications and how they are different from conventional applications. The .NET Framework allows you to create distributed applications in various ways. Two popular approaches are .NET remoting and ASP.NET Web services. I'll discuss .NET remoting in this chapter and cover ASP.NET Web services in the next two chapters.
In this chapter, you'll start learning about remoting by understanding its architecture. You'll learn about various remoting elements, such as remotable classes, remoting hosts , remoting clients , channels, formatters, and activation modes, and you'll also learn how these elements fit together to create a distributed application. I'll compare the various choices available with each of these remoting elements and explain how to decide between those choices in a given scenario.
The next part of the chapter is code intensive . You'll write code to practice creating small but fully functional distributed applications. While working with the step-by-step exercises, you'll develop various skills instrumental for designing remoting applications (and of course also for passing this exam).
I'll first show you how to create a class that can be remoted across network and application boundaries. I'll then show how to create a remoting host that hosts the class so that the client program can take the services offered by the remotable class. I'll also show how to create a client program that can instantiate a remote object and invoke methods on it.
I'll discuss various types of applications that can work as remoting host, such as a console application, a windows service, or IIS (Internet Information Services). I'll also discuss how you can use configuration files to conveniently modify the behavior of both the remoting host as well as the remoting client application.
Finally in this chapter, I'll show how to program the client application to invoke remote method calls asynchronously. Asynchronous method invocations, as you'll see, boost the responsiveness of the client application and keep users happy.