Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1037623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:52:25+00:00 2026-05-16T14:52:25+00:00

I am not suggesting that all models are tables. What I am asking is

  • 0

I am not suggesting that all models are tables.

What I am asking is whether every single table must also have its own class defined specifically for it when using Zend? Is there any way of getting away from this awkward boiler-plate coding. We’re just starting to look into Zend (hoping to leave procedural PHP land!) and my colleague thinks this could end up being pretty time-consuming.

Is this the reason for people using ORM solutions? Is there any other way around this?

Thanks for your replies.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:52:25+00:00Added an answer on May 16, 2026 at 2:52 pm

    The Zend Table classes follow the Table Data Gateway pattern, which by definition

    … holds all the SQL for accessing a single table or view: selects, inserts, updates, and deletes. Other code calls its methods for all interaction with the database.

    In the book, Fowler is not that rigid about that, saying that

    for very simple cases, you can have a single TDG that handles all methods for all tables. You can even have one for views or even for interesting queries that aren’t kept in the database as views.

    However, except for being able to use Views, Zend_Db_Table does not accomodate for this. You can create queries to multiple tables, but those would have to be made through the Zend_Db_Adapter directly or – when using joins – by switching off the integrity check. Otherwise, you have to use the API offered by Zend_Db_Table Relationships

    So yes, one instance should correspond to one table or view. You do not need to create classes for that though if you dont plan on extending the classes. Zend_Db_Table_Definitions allow you to configure Zend_Db_Table instances on the fly.

    Note that TDG is a DataSource Architectural Pattern and not an Object-Relational pattern. It’s purpose is not to help with impedance-mismatch, but with separating database access code from business logic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a form that needs to show data from 2 tables (parent
Ok, I have a question that I know is very opinionated (based on all
I have checked this similar question, but the suggestions did not solve my problem:
Trying to comply with StackOverflow's suggestion of asking a question, not creating a discussion,
I have 2 models - batch and submision. Batch has_many :submissions Submission belongs_to :batch
I have a deep hierarchical model that looks like this: Accounts -> Venues ->Events
I'm using Django and have two classes: class PR(models.Model): Jq = models.ForeignKey(JQ) user =
I'm asking here not because I never used visual studio but because I'm starting
I've three table 'Hardware_model','Warehouse' and 'Brand' and tables are refernced together in this way:
I'm trying to create a SQL Server script that applies some operations to all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.