Chapter 14. Creating Distributed Applications with Remoting

 < Day Day Up > 

Topics in This Chapter

  • Application Domains: The logical partition within which a .NET application runs is called an application domain (or AppDomain). In this chapter, we examine how applications communicate and access resources across AppDomain boundaries.

  • Remoting: An application may call a method that resides in another AppDomain, another process, or on another machine. This process, known as remoting, requires creating a client and server that agree to communicate across these boundaries. This chapter looks at the options available to implement remoting.

  • Leasing and Sponsorship: Garbage Collection in .NET does not recognize remote references when removing objects. To prevent a remote object from being destroyed, .NET provides a Lease object that is used to reference a remote object so that it avoids Garbage Collection.

This chapter introduces the .NET way of developing distributed applications. The emphasis is on how a technique known as remoting permits client computers to access resources on other local or remote computers. Remoting is typically designed for intranet applications, although it does support the HTTP protocol for communicating over the Internet. In some cases, it may be regarded as an alternative to Web Services and a Web browser. We'll see in this chapter that remoting offers more flexibility and a richer set of features than these standard Web-based solutions.

To fully appreciate remoting technology, it is necessary to understand the relationship among processes, application domains, and assemblies. Toward that end, the first section explains the role of the application domain in the .NET architecture. We'll see that the security and code isolation it offers requires that objects in separate AppDomains agree upon the port number, protocol, and type of message formatting before they can communicate.

The second section forms the heart of the chapter. It provides both a conceptual and hands-on approach to remoting. Code examples illustrate how to select and implement the remoting options that best fit a distributed application. The section describes how to create client-and server-activated objects, select formatting and protocol options, deploy assemblies for a distributed application, and use leases to manage the lifetime of an object.

You may want to follow up this chapter by reading the chapter on Web Services, which presents a second .NET technique for implementing a distributed application. Although there are conceptual similarities between remoting and Web Services, there are also distinct differences in performance, interoperability, and implementation complexity that an architect must understand. A reading of these chapters should provide the know-how to select the approach that best meets the requirements of your distributed application.

     < Day Day Up > 


    Core C# and  .NET
    Core C# and .NET
    ISBN: 131472275
    EAN: N/A
    Year: 2005
    Pages: 219

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net