architect-handbook

Software Architect Handbook

View on GitHub

Query Object

“An object that represents a database query.”

Overview

A Query Object is an Interpreter (Gang of Four), that is, a structure of objects that can form itself into a SQL query. You can create this query by refering to classes and fields rather than tables an columns.

In this way those who write the queries can do so independently of the database schema and changes to the schema can be localized in a single place.

How It Works

When to Use It