.NET
  Home arrow .NET arrow Page 4 - .NET Remoting and Delphi
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

.NET Remoting and Delphi
By: Xavier Pacheco
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 14
    2004-08-09

    Table of Contents:
  • .NET Remoting and Delphi
  • Distributed Architectures
  • Benefits of Multitier Application Development
  • .NET Remoting Basics
  • The ChannelServices Class
  • Object Activation
  • Your First .NET Remoting Application
  • Adding References
  • BankPackage.dll: Contract Between Clients and Servers
  • Implementing the Server
  • Implementing the Client

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    .NET Remoting and Delphi - .NET Remoting Basics


    (Page 4 of 11 )

    The following sections provide an overview of the .NET remoting technology.

    Architectural Overview

    The .NET Remoting architecture is extremely flexible and provides developers with a framework that is easy to customize and extend.

    This section provides you with a brief description of the most important elements of the framework and introduces a few concepts only present in .NET Remoting.

    Application Domains

    Application Domains are at the core of the remoting infrastructure and represent the boundaries for Interprocess Communication (IPC).

    In classical Win32, Windows creates a new process when an executable is launched. Processes are the lowest level of isolation and cannot directly share memory between each other. Memory addresses are process relative: Pointers to memory in one process are meaningless to another.

    Application Domains, or AppDomains, are to .NET what processes are to Win32. AppDomains provide a more granular level of separation and better security than Win32 processes.

    You can run several application domains in a single process with the same level of isolation that would exist in separate processes, but without incurring the additional overhead of making cross-process calls or switching between processes. Figure 29.6 illustrates this concept.

    .NET Remoting is necessary to make objects in one domain communicate with those hosted in another, regardless of the domains being in the same process or in processes running on different machines.

    The System.Runtime.Remoting Namespace

    In order to develop applications that use .NET Remoting, you will need to reference the namespace System.Runtime.Remoting in both your clients and servers.

    delphi

    Figure 29.6
    Cross AppDomain communication using .NET Remoting.

    The System.Runtime.Remoting namespace and those depending on it provide classes and interfaces that allow developers to create and configure distributed applications.

    The RemotingConfiguration Class

    The RemotingConfiguration class contains static class methods for interfacing with configuration settings and register objects so that they can be remotely invoked.

    The following snippet of code registers the class TBankManager:

    RemotingConfiguration.RegisterWellKnownServiceType(
      typeOf(TBankManager),
      'BankManager.soap',
      WellKnownObjectMode.Singleton);

    More about this method is explained in the section "Server Activation."

    Remoting settings can be programmatically set or can be read from external configuration files.

    The RemotingConfiguration.Configure() method allows developers to configure the Remoting infrastructure through the use of XML formatted configuration files.

    This is how you would use it:

    RemotingConfiguration.Configure('MyConfiguration.config');

    The configuration files can contain information such as the networking protocol to use for remote communication, the TCP or HTTP port used, the message formatting type (SOAP or binary), and more.


    Note - Refer to the section called "Remoting Settings Schema" in the MSDN Online Library for more information at http://msdn.microsoft.com/library/default.asp?url=/library/enus/cpgenref/html/gnconRemotingSettingsSchema.asp


    This chapter is from Delphi for .NET Developer's Guide, by Xavier Pacheco (Sams, 2004, ISBN: 0-672-32443-1). Check it out at your favorite bookstore today.

    Buy this book now.

    More .NET Articles
    More By Xavier Pacheco


       · in time compiling is message:Incompatible types 'IBankManager' and 'Object'where...
       · is in WinformfBankManager := Activator.GetObject( typeof(IBankManager), ...
     

    .NET ARTICLES

    - Using CrystalReportViewer to Display Crystal...
    - Creating Summary .Net Crystal Reports
    - More on Commands, Input and the WPF
    - Grouping and Aggregating When Querying LINQ ...
    - Commands, Input and the WPF
    - Keyboard and Ink Input with WPF
    - Mouse Input and the WPF
    - Input with Windows Presentation Foundation
    - Introducing LINQ with XML and Databases
    - An Introduction to LINQ
    - Querying LINQ to SQL: Basics
    - Completing a Simple Storefront with LINQ
    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT