.NET Remoting and Delphi - Your First .NET Remoting Application
(Page 7 of 11 )
Developing Delphi applications that make use of .NET remoting is a relatively easy process, and, if you used COM, you will find that it's conceptually very similar to developing OLE automation servers. Luckily, registration of remotable objects is much simpler. It can be done programmatically (RemotingConfiguration method calls) or declaratively (using an XML configuration file). You no longer have to deal with type libraries.
The following example, although simple, shows how to best structure .NET Remoting projects and contains a certain amount of real-world business logic.
The server of this example represents a bank service. It contains a list of bank accounts (two to be precise) and allows to query for the details of these (account number, name of the person associated with it, and its balance) and to do a money transfer.
Setting Up the Project
We'll start the development of our bank system by creating a project group and three empty projects (a Package, a Console Application, and a Windows Forms Application) that we will complete in the following sections.
Select File, New, Other. Click Other Files and select Project Group, as shown in Figure 29.7.

Figure 29.7
Setting up a project group.
Save the project group as BankExample.
It's very convenient to use project groups when developing distributed applications, especially at early stages. Project groups provide you with an immediate look at all the elements of your systems and allow you to switch between them more efficiently than with individual projects.
Add the Package to the group by clicking the New button inside the Project Manager panel and then selecting Package, as shown in Figure 29.8.

Figure 29.8
Selecting a Package.
Repeat the operation and add a Console Application and a Windows Forms Application to your project group.
Once done, save and name the projects as shown in Table 29.1.
Table 29.1 Project Names in the Project Group
Project Type | Project Name |
Package | BankPackage.dll |
Console Application | BankServer.exe |
WinForms Client | BankClient.exe |
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. |
Next: Adding References >>
More .NET Articles
More By Xavier Pacheco