12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>C++</strong>Builder Database Architecture<br />

and Sybase, the BDE communicates with back-end database servers us<strong>in</strong>g SQL L<strong>in</strong>ks and/<br />

or ODBC drivers. Often these drivers make calls to native driver libraries supplied by the<br />

DBMS vendor. Figure 12.1 illustrates this relationship.<br />

Figure 12.1.<br />

<strong>C++</strong>Builder implements<br />

a simple, yet<br />

flexible, databaseaccess<br />

architecture.<br />

Native DBMS driver<br />

Your application<br />

BDE alias<br />

BDE driver<br />

ODBC driver<br />

With<strong>in</strong> your applications, data-aware controls reference TDatasource components. Usually,<br />

a given form makes use of only a handful of TDatasource controls, although it may <strong>in</strong>clude<br />

numerous data-aware components. These components reference one or more TDatasource<br />

controls that, <strong>in</strong> turn, reference one or more TDatasets. It’s not unusual for a form to <strong>in</strong>clude<br />

just one TDataset and one TDatasource. Figure 12.2 illustrates how these elements relate to<br />

one another.<br />

The flexibility <strong>in</strong>herent <strong>in</strong> this multilevel architecture makes it quite easy to develop database<br />

applications that are not only robust, but also scalable. Thanks to the separation of the backend<br />

BDE drivers from your front-end application components, it’s at least theoretically<br />

possible to change an application’s database back end without even recompil<strong>in</strong>g the app. The<br />

architecture’s modularity allows <strong>in</strong>dividual pieces of it to be replaced without hav<strong>in</strong>g to<br />

reeng<strong>in</strong>eer it or rebuild applications based on it.<br />

Now that I’ve given you a broad overview of the architecture, let me make a few general<br />

statements that may help re<strong>in</strong>force the concepts I’ve just discussed. You may be say<strong>in</strong>g, “This<br />

architecture stuff sounds nifty, but how do I use it? How does it apply to me? What does all<br />

this really mean?” If this sounds like you, hopefully the follow<strong>in</strong>g tips will help crystallize the<br />

discussion thus far.<br />

431<br />

12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!