Presentation is loading. Please wait.

Presentation is loading. Please wait.

Overview General Comments About Delphi’s Data Access Technologies

Similar presentations


Presentation on theme: "Overview General Comments About Delphi’s Data Access Technologies"— Presentation transcript:

1 Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc.

2 Overview General Comments About Delphi’s Data Access Technologies
Overview of Data Access Technologies The Borland Database Engine dbExpress dbGo (ADO) MyBase InterBase Express DataSnap Third-Party Data Access Options Data Modules Data Aware Controls Programming with Data Providers

3 TDataSet The Origins The Legacy Things changed with Delphi 3
Paradox, the Paradox Engine, ODAPI, IDAPI, IDAPI, BDE The Legacy A navigational interface in a largely set-based world Things changed with Delphi 3

4 Borland Database Engine (BDE)
Delphi C++ Builder Data Gateway Visual dBASE Borland Database Engine (BDE) SQL Links ODBC Socket TCP/IP, SPX/IPX, NetBEUI ODBC Driver Local Tables Paradox, dBASE, Access, FoxPro Remote Tables Oracle, Sybase, MS SQL Server, ... ODBC-ready databases

5 Session (default) BDE Database (default) DataSets (Table, Query, StoredProc) DataSource Data Controls (DBGRid, etc.)

6 Many legacy applications exist which use it
BDE Advantages If you already have it installed and working for existing applications, new applications require little or no configuration to use it Many legacy applications exist which use it Two or more applications written in Delphi can easily share global aliases It has relatively good performance across a large number of data types It provides access to installed ODBC drivers

7 BDE Limitations In the typically deployment of BDE-based applications, a copy of the BDE must be installed and configured on each workstation (a network installation is possible, but requires manual registry configuration) The BDE is somewhat inefficient, in that it stores as many as three copies of table metadata When used with local tables such as Paradox tables, failure to correctly configure the BDE can produce periodic index corruption If a new BDE application is incorrectly installed, existing BDE applications may fail to initialize properly The BDE is available only for the Windows platform

8 Delphi’s dbExpress Components
dbExpress Driver Vendor Library Database

9 dbExpress SQLConnection Unidirectional DataSets DataSetProvider ClientDataSet SQLClientDataSet DataSource Data Aware Controls

10 dbExpress Advantages Data-related operations in dbExpress tend to be faster than using other technologies dbExpress-based applications can be deployed under both Windows and Linux environments Applications designed to use dbExpress can more easily be ported to using DataSnap dbExpress applications require fewer support files and can require far less configuration than BDE applications

11 dbExpress Limitations
dbExpress applications are generally more complicated than other types of Delphi database applications to program. In addition to requiring more components to access and edit data, dbExpress applications often require more lines of code than non-dbExpress applications There are relatively few dbExpress drivers available

12 Microsoft Universal Data Access (MDAC)
Delphi ADO Datasets ActiveX Data Access Components OLE DB Provider Plugable Layer Data (database, spreadsheet, document, etc.) Data

13 ActiveX Data Objects TADOConnection TADOCommand TDataSet Descendants DataSource Data Aware Controls

14 ADO Advantages All Windows-based computers shipped in the past few years already have MDAC installed. As a result, most ADO-based applications require only the installation of the specific OLE DB provider, at most ADO can be used from a wide range of development environments, including MS Access, VisualBasic, Delphi, Visual C++, to name of few A wide range of OLE DB providers are available Applications that have been deployed as COM+ applications (formerly referred to Microsoft Transaction Server components), can pool ADO connections, producing improved performance in environments that require large numbers of independent requests for data, such as Web server extensions

15 ADO Limitations ADO is available only for the 32-bit Windows operating system Having MDAC installed and configured is not enough. In some cases, you must also install and register an appropriate OLE DB provider Performance using ADO is largely reliant on the quality of the OLE DB provider that you are using If you are using the OLE DB provider for ODBC, an appropriate ODBC driver must also be installed and configured

16 if MidasLib unit not used
MyBase - ClientDataSet ClientDataSet MIDAS.DLL if MidasLib unit not used Local File XML or CDS

17 MyBase ClientDataSet DataSource Data Aware Controls

18 MyBase applications have minimal installation requirements
MyBase Advantages MyBase applications have minimal installation requirements The data can be stored in XML format, making it easy to access this data from outside of the application Data can be loaded and saved without code. Simply point the client dataset's FileName property to a file that contains the proper XML or binary client dataset data, and it will take care of the rest. (It is better to explicity load and save using SaveToFile and LoadFromFile)

19 MyBase Limitations Because the records in a client dataset are stored in-memory, the number of records that you can load is limited by the amount of real and virtual memory available on your machine Large files may take a significant amount of time to load from a file into a client dataset. For example, 100,000 records may take 5 seconds or so to load into memory MyBase applications are limited to single user applications. If you want to create a multiuser application, you must use one of the other available technologies

20 InterBase Express IBDatabase gds32.dll InterBase

21 InterBase Express IBTransaction IBDatabase IBTransaction IBSQL IBTable, IBQuery, IBStoredProc, IBDataSet DataSource Data Aware Controls

22 InterBase Express Advantages
InterBase Express provides access to InterBase without the BDE Because InterBase Express components are designed specifically for InterBase, they include a number of specialized components that access and leverage InterBase features Interbase Express components are available for both Delphi and Kylix, meaning that you can build applications that employ InterBase Express for machines running Linux

23 InterBase Express Limitations
InterBase Express works only with the InterBase database server

24 DataSnap DataSnap Clients DataSnap Server Database Server

25 with DataSetProviders
Remote Connection Component Remote Data Module with DataSetProviders Data Access Components Database

26 DataSnap DataSetProvider Connection Components LocalConnection SharedConnection ConnectionBroker ClientDataSet DataSource Data Aware Controls

27 DataSnap client applications have few installation requirements
DataSnap Advantages DataSnap client applications have few installation requirements Business rules can be implemented on a server, permitting these rules to be updated independent of the individual client applications They permit load balancing They can implement fail-over for high reliability They provide a reliable, distributed upgrade path to dbExpress and MyBase applications The connection components support a variety of internetworking protocols

28 DataSnap Limitations While DataSnap offers additional flexibility over traditional client/server solutions, it requires more development. Specifically, in addition to writing the client application, you also need to write the application server DataSnap applications require an additional license before they can be deployed. However, since Delphi 6, this license comes with the Enterprise and Architect editions of Delphi DataSnap servers must also employ one of the other data access mechanisms. For example, the application server may use the BDE or ADO. As a result, DataSnap application developers must be familiar with at least two data access mechanisms (DataSnap plus at least one more)

29 Third-Party Data Access Components

30 Third-Party Data Controls Advantages
May support specialized features of the vendor’s database If designed with the TDataSet interface in mind, it may be easy to convert from some other data access mechanism to the vendor’s data access mechanism Third-party vendors are generally highly motivated to provide nearly bug-free components

31 Third-Party Data Controls Limitations
Typically support only one database Ties you to that vendors database

32 Data Modules Non-visual container for non-visual components
Permit sharing of objects Excellent classes for implementing custom components Are not always appropriate for data controls, especially in the following situations Multi-instance forms Forms used for reports Unique data views

33 Data Aware Controls Convenient and effective
Permit you to build interfaces quickly Automatically respond to changes in the data Some developers have a bias against data aware controls In response, they often create their own framework of data awareness with custom controls

34 Using Providers in Database Applications
Independent layer for data access Decouples your user interface from the data access mechanism Is a more generalized approach than data modules

35

36 Thank You !

37


Download ppt "Overview General Comments About Delphi’s Data Access Technologies"

Similar presentations


Ads by Google