From d33132b9cf27f0213562896033dc52565c8318f9 Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 20 Aug 2007 12:09:02 +0000 Subject: fixed typos. --- .../protected/pages/Database/ActiveRecord.page | 224 ++++++++++----------- .../protected/pages/Database/SqlMap.page | 86 ++++---- 2 files changed, 155 insertions(+), 155 deletions(-) (limited to 'demos/quickstart/protected/pages/Database') diff --git a/demos/quickstart/protected/pages/Database/ActiveRecord.page b/demos/quickstart/protected/pages/Database/ActiveRecord.page index c97711d6..e5ddcdfd 100644 --- a/demos/quickstart/protected/pages/Database/ActiveRecord.page +++ b/demos/quickstart/protected/pages/Database/ActiveRecord.page @@ -4,43 +4,43 @@

Active Records are objects that wrap a row in a database table or view, encapsulate the database access and add domain logic on that data. - The basics of an Active Record are business classes, e.g., a + The basics of an Active Record are business classes, e.g., a Products class, that match very closely the record structure of an underlying database table. Each Active Record will be responsible for saving and loading data to and from the database.

Info: - The data structure of an Active Record should match that of a table + The data structure of an Active Record should match that of a table in the database. Each column of a table should have a corresponding member variable or property in the Active Record class the represents the table.

When to Use It

-

Active Record is a good choice for domain logic that isn't too complex, +

Active Record is a good choice for domain logic that isn't too complex, such as creates, reads, updates, and deletes. Derivations and validations based on a single record work well in this structure. Active Record has the - primary advantage of simplicity. It's easy to build + primary advantage of simplicity. It's easy to build Active Records, and they are easy to understand.

-

However, as your business logic grows in complexity, you'll soon want +

However, as your business logic grows in complexity, you'll soon want to use your object's direct relationships, collections, inheritance, and so - forth. These don't map easily onto Active Record, and adding them piecemeal + forth. These don't map easily onto Active Record, and adding them piecemeal gets very messy. - Another argument against Active Record is the fact that it couples the object + Another argument against Active Record is the fact that it couples the object design to the database design. This makes it more difficult to refactor as a project goes forward.

- +

The alternative is to use a Data Mapper that separates the roles of the - business object and how these objects are stored. - Prado provides a complimentary choice between Active Record and - SqlMap Data Mapper. + business object and how these objects are stored. + Prado provides a complimentary choice between Active Record and + SqlMap Data Mapper. A SqlMap Data Mapper can be used to load Active Record objects, in turn; these - Active Record objects can be used to update the database. + Active Record objects can be used to update the database. The "relationship" between Active Records and SqlMap is illustrated in the following diagram. More details regarding the SqlMap Data Mapper can be found in the SqlMap Manual. alt="Active Records and SqlMap DataMapper" id="fig:diagram.png" class="figure"/>

- +

The Active Record class has functionality to perform the following tasks.

@@ -52,8 +52,8 @@

Database Supported

-The Active Record implementation utilizes the Prado DAO classes for data access. -The current Active Record implementation supports the following database. +The Active Record implementation utilizes the Prado DAO classes for data access. +The current Active Record implementation supports the following database.