Difference between revisions of "SQLdb Tutorial4"
m |
|||
Line 1: | Line 1: | ||
− | |||
− | |||
[[Category:Tutorials]] | [[Category:Tutorials]] | ||
[[Category:Lazarus]] | [[Category:Lazarus]] | ||
Line 7: | Line 5: | ||
INTRODUCTION | INTRODUCTION | ||
− | This tutorial is an attempt to demonstrate the use of Lazarus DataModules to isolate the Data Access components of a project from the program logic associated with the access. Such isolation makes program maintenance and debugging easier. | + | This tutorial is an attempt to demonstrate the use of Lazarus DataModules to isolate the Data Access components of a project from the program logic associated with the access. Such isolation makes program maintenance and debugging easier. This tutorial was developed using Windows 7 and SQLite3 as the database, with Lazarus 1.0.8 with FPC 2.6.2, however it should work with earlier versions. Similarly, other DBMS and Operating Systems should require minimal change. |
+ | |||
+ | WHAT IS A DATAMODULE? | ||
+ | |||
+ | A DataModule allows the collection of any NON-VISUAL components. Datamodules cannot contain visual components, such as TEDIT. TSTRINGGrid. DBGrid, etc - but can contain non-visual components like DBConnect, DBTransaction, etc. | ||
+ | |||
WHY USE DATAMODULES? | WHY USE DATAMODULES? | ||
Line 16: | Line 19: | ||
Tut3 | Tut3 | ||
− | Developing a 'real' application becomes harder. 'Form1' grows to an exponential size handling the different Events and Database Queries. By isolating each Table access into a single | + | Developing a 'real' application becomes harder. 'Form1' grows to an exponential size handling the different Events and Database Queries. By isolating each Table access into a single DataModule makes debugging and maintenance so much easier |
Revision as of 05:59, 4 May 2013
INTRODUCTION
This tutorial is an attempt to demonstrate the use of Lazarus DataModules to isolate the Data Access components of a project from the program logic associated with the access. Such isolation makes program maintenance and debugging easier. This tutorial was developed using Windows 7 and SQLite3 as the database, with Lazarus 1.0.8 with FPC 2.6.2, however it should work with earlier versions. Similarly, other DBMS and Operating Systems should require minimal change.
WHAT IS A DATAMODULE?
A DataModule allows the collection of any NON-VISUAL components. Datamodules cannot contain visual components, such as TEDIT. TSTRINGGrid. DBGrid, etc - but can contain non-visual components like DBConnect, DBTransaction, etc.
WHY USE DATAMODULES?
Simple - after following the Lazarus Tutorials: Tut1 Tut2 Tut3
Developing a 'real' application becomes harder. 'Form1' grows to an exponential size handling the different Events and Database Queries. By isolating each Table access into a single DataModule makes debugging and maintenance so much easier