查询对象模式(设计模式) [英] Query Object Pattern (Design Pattern)

查看:227
本文介绍了查询对象模式(设计模式)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Java中实现一个查询对象模式,用于可定制的搜索界面(我正在撰写的webapp)。

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

有人知道我可以在哪里查询对象模式(Martin Fowler's QoP)的示例/教程?

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

感谢提前

添加如何向现有DAO模式添加查询模式?

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

推荐答案

模式查询对象模式(IMHO)置于错位。这不是真正的设计模式。 查询对象仅仅是口译员模式的另一个例子。旧版 Hibernate Criteria API 和现代的<一个href =http://docs.oracle.com/javaee/6/api/javax/persistence/criteria/package-summary.html =noreferrer> JPA2 Criteria API 是一个很好的例子,将其与生成器模式结合使用。

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.

关于你的问题:


如何向现有的DAO模式添加查询模式?

我建议看看 JPA2

这篇关于查询对象模式(设计模式)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆