2.5 Conclusion


This chapter examined issues around persistence frameworks and how or when they should be used in applications.

O/R mapping should be used when existing database applications have to run together with newly developed applications ”for instance, a mature procurement system that needs to be accessed via the Internet. Existing data analysis tools like OLAP-based data mining tools or reporting solutions can be a reason to use O/R mapping as well. To become independent of database vendors may be another advantage of O/R mapping tools. Although it is doubtful that an application runs out-of-the-box on a different database system with expected performance, a mapping layer helps to port such applications in a fraction of the time. The JDO and JDBC chapter in this book examines these issues in more detail.

If the application uses a deeply hierarchical object model, like XML document-oriented or CAD applications, a relational database system can be too slow. Navigational access may result in a number of queries, which can be difficult to tune. In such cases, object-oriented or XML-based databases are a better choice. In the embedded domain, even a database system may be too large because of restricted memory and code space. Nevertheless, there are small, file-based solutions that can be used via the JDO API.

Although a portion of this chapter focuses specifically on O/R-based transparent persistence, many of the issues discussed remain the same for non-relational datastores. For example, even if data is persisted in an object-database or native XML store, the essential questions of transactional objects, caches, and query translations from one language into another remain.

If the object model is simple and stable, using O/R mapping tools may be "overkill" compared to the effort of an application-specific persistence implementation. The decision should also depend on resource consumption, number of parallel accesses , data consistency requirements, and the need for query capabilities. A really bad idea is to design another mapping layer on top of JDO, to implement the application independent of various persistence frameworks like ODMG, JDO, and other, vendor-dependent solutions. The fundamental purpose of JDO, transparent persistence, will be lost in such a case.

Chapter 3 looks at how JDO addresses the issues discussed in this chapter.



Core Java Data Objects
Core Java Data Objects
ISBN: 0131407317
EAN: 2147483647
Year: 2003
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net