| Article: |
Object-Relational Mapping with Apache Jakarta OJB | |
| Subject: | hiding details of persistence layer | |
| Date: | 2003-01-09 10:03:24 | |
| From: | ccnelson | |
|
I agree whole-heartedly with the idea of hiding the details of which persistence layer is being used behind interfaces. However, in your article you state that abstracting the Criteria stuff in OJB can be accomplished with a "little more work". I would be curious to hear you and others thoughts on that. It seems to me to be a non-trivial thing to do. Having to add methods to your interface that perform only specific queries would seem to be not always flexible enough for real world apps. And since there is no "standard" query API one is left in a bit of a quandry. Things like OQL are not good enough IMHO because it is better to have an object based API (like the OJB Criteria API) than having to manipulate OQL Strings in code.
|
||
Showing messages 1 through 1 of 1.
-
less ideal
2003-01-09 13:01:28 charlesc [View]



Without a standard query API, there's really no other way. You can create your own Criteria objects and translate into OJB Criteria API ... but the amount of work probably don't justify.
Having a QueryManager is less elegant but at least, it achieves encapsulation. :)