views:

662

answers:

2

Hi Guys,

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?

+1  A: 

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.

BalusC