Query Object Pattern


Definition
A Query Object is an interpreter, that is, a structure of objects that can form itself into a SQL query (martin fowler).

Applicability
  • When there is a need to avoid to know what the database schema looks like to form queries.

Consequences
  • Hides the SQL inside parameterized methods.
  • 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.

Downsides
  • Makes it difficult to form more ad hoc queries.

Sample Code

Comments

  1. Very significant Information for us, I have think the representation of this Information is actually superb one. This is my first visit to your site. South Florida Family Law Mediation

    ReplyDelete

Post a Comment

Popular Posts