Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Query Object Pattern (Design Pattern)

I need to implement a Query Object Pattern in Java for my customizable search interface (of a webapp I'm writing).

Does anybody know where I can get an example/tutorial of Query Object Pattern (Martin Fowler's QoP)?

Thanks in Advance

ADDITION How to add a Query Pattern to an existing DAO pattern?

like image 905
Buhake Sindi Avatar asked Jan 15 '10 00:01

Buhake Sindi


1 Answers

The word "pattern" in the "Query Object Pattern" is (IMHO) misplaced. It's not a real design pattern. The "Query Object" is just another example of the Interpreter Pattern. The legacy Hibernate Criteria API and the modern JPA2 Criteria API are an excellent examples which combines it with the Builder Pattern.

As to your question:

How to add a Query Pattern to an existing DAO pattern?

I would recommend to have a look at JPA2.

like image 60
BalusC Avatar answered Sep 30 '22 17:09

BalusC