This is a design problem I face regularly and I\'d like to find some general insights about the subject. The code provided here is just an example.
In the design pha
It depends on your architecture. The four common Data Source Architectural Patterns can be found in Martin Fowler's Patterns of Enterprise Application Architecture:
Table Data Gateway
An object that acts as a Gateway to a database table. One instance handles all the rows in the table.
Row Data Gateway
An object that acts as a Gateway to a single record in a data source. There is one instance per row.
Active Record
An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.
Data Mapper
A layer of Mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself.
Further patterns:
The Zend Framework quickstart has a, pretty easy to grasp, overview of models and mappers (google'able terms), together with some source code.
Have you considered using a Object Relational Mapping library like Doctrine or Propel?