Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 2 - Using the Client Dataset in an N-Tiered Ap...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
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? 
DELPHI-KYLIX

Using the Client Dataset in an N-Tiered Application
By: Danish Ahmed
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2008-01-02

    Table of Contents:
  • Using the Client Dataset in an N-Tiered Application
  • Application Server
  • Client Application
  • Connecting to the Application Server

  • 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


    Using the Client Dataset in an N-Tiered Application - Application Server


    (Page 2 of 4 )

     

    The application server resides in the middle tier and acts as an intermediary between the client application and the database server. In some ways the application server plays the same role that the dataset provider plays while acting as an intermediary between the client dataset and the database server.

    Creating an application server in Delphi is a bit different from creating other applications. If you intend to create a web service using SOAP as the transport protocol, choose Web Server as the the type of application in the SOAP Server application category of the new item dialog box. If you are using any other protocol like DCOM or TCP/IP, simply select new application from the File menu or New Items dialog box.

    What makes the application server different from other applications is the remote data module which acts as the broker for the application server. You can add the TRemoteDataModulecomponent to your application from the Multitier category of the New Items dialog box. This module acts as the repository of all objects in an application server and implements the IAppServer interface that the client application uses to connect to the server. When you create a new RemoteDataModule, you are required to specify a class name which acts as the base name of the interface of that class. You can also specify the kind of threading model you want to implement and the number of instances you wish to allow.

    If you are creating a Web Service you can add TSoapDataModulefrom the Web Services page of the New Items dialog box. It implements an invokable interface, the IAppServerSOAPinterface, to communicate information in a SOAP-based multi-tiered database application. As with TRemoteDataModule, TSoapDataModule alsorequires a class name during creation which acts as the base name of the interface for that class. There are more ways to create an application server but I will not go into the details. Instead, I will proceed to demonstrate how a remote data module and dataset provider can be utilized in the application server.

    After adding a remote data module according to your requirements, drop database components that interact with the database server on the data module. For instance, to connect to a Microsoft SQL Server using ADO, drop a TADOTable component, specify the connection parameters in its ConnectionStringproperty and the table you want to access in the TableName property. Next add a dataset provider component and assign the TADOTable component's name to the dataset property of the dataset provider. This will ensure that when the client dataset connects to it and requests data, it will fetch the required records from the connected TADOTable instance. Add a dataset provider component for every dataset that you want to access from the client. If you are using XML documents for storing data, add a XMLProvider component for every XML document.

    You can use the event handlers of the module to write code to ensure that the transactions and operations conform to the business rules. They can also be used to implement custom methods and influence the data packets that are being sent to the server for update. This feature is discussed in the follow-up article.

    An application server does not initiate connection with the client; it waits for the client to initiate a connection. So after creating the application it would be necessary to make sure that it is found by the client application. Executing it once to get it registered as an application server, the client application can then find it and receive the IAppServer interface through which it interacts with the application server. You can also register it by passing the “/regserver” parameterin the command line or using the parameter option in the IDE. To unregister it, simply pass the “/unregserver” parameter. 

     

    More Delphi-Kylix Articles
    More By Danish Ahmed


     

    DELPHI-KYLIX ARTICLES

    - Building a Server Application for an Interne...
    - Building an Internet Access Control Applicat...
    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...
    - Using the Client Dataset in Two-Tiered Clien...
    - Using the Client Dataset in File-Based Archi...
    - Demystifying the Client Dataset
    - Working with INI Files in Delphi
    - Creating Data Link (UDL) Files in Delphi
    - Looking at the Details for an Invoicing Appl...
    - Invoicing in Delphi: Show Me the Money
    - Saving Images and Binary Files to a Database...
    - Saving Files to a Database using Delphi: Sav...
    - Creating CF Applications and Integrating a S...
    - Using Try and Finally to Help Prevent Memory...







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway