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
Useful Information..!!! Best blog with effective information’s..!!
ReplyDeleteweb designing training in chennai
PHP Course in Chennai
Best Spoken English Classes in Chennai
German Language Course in Chennai
Salesforce Course in Chennai
IELTS Coaching centre in Chennai
Design pattern is an important concept to learn as they simplify the design and architecture of applications and systems. Problems based on design patterns and algorithms are frequently asked in programming interviews. Thank you for sharing your valuable knowledge. Great blog. Coding interview questions
ReplyDeleteThis is what exactly the specification pattern does as well.
ReplyDelete