Skip to main content

Efficient Object Querying for Java

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 4067))

Abstract

Modern programming languages have little or no support for querying objects and collections. Programmers are forced to hand code such queries using nested loops, which is both cumbersome and inefficient. We demonstrate that first-class queries over objects and collections improve program readability, provide good performance and are applicable to a large number of common programming problems. We have developed a prototype extension to Java which tracks all objects in a program using AspectJ and allows first-class queries over them in the program. Our experimental findings indicate that such queries can be significantly faster than common programming idioms and within reach of hand optimised queries.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. The Standard Performance Corporation. SPEC JVM98 benchmarks (1998), http://www.spec.org/osg/jvm98

  2. Baker, H.G.: Iterators: Signs of weakness in object-oriented languages. ACM OOPS Messenger 4(3) (July 1993)

    Google Scholar 

  3. Barnett, M., DeLine, R., Fahndrich, M., Rustan, K., Leino, M., Schulte, W.: Verification of object-oriented programs with invariants. Journal of Object Technology 3(6), 27–56 (2004)

    Article  Google Scholar 

  4. Bierman, G., Meijer, E., Schulte, W.: The Essence of Data Access in Cω. In: Black, A.P. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 287–311. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  5. Bierman, G., Wren, A.: First-Class Relationships in an Object-Oriented Language. In: Black, A.P. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 262–286. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  6. Booch, G., Jacobson, I., Rumbaugh, J.: The Unified Modeling Language User Guide. Addison-Wesley, Reading (1998)

    Google Scholar 

  7. Ceri, S., Widom, J.: Deriving production rules for incremental view maintenance. In: Proceedings of the International Conference on Very Large Data Bases (VLDB), pp. 577–589. Morgan Kaufmann, San Francisco (1991)

    Google Scholar 

  8. Chiba, S.: A metaobject protocol for C++. In: Proceedings of the ACM conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA), pp. 285–299. ACM Press, New York (1995)

    Google Scholar 

  9. Cook, W.R., Ibrahim, A.H.: Programming languages & databases: What’s the problem? Technical report, Department of Computer Sciences, The University of Texas at Austin (2005)

    Google Scholar 

  10. Cook, W.R., Rai, S.: Safe query objects: Statically typed objects as remotely executable queries. In: Proceedings of the International Conference on Software Engineering (ICSE), pp. 97–106. IEEE Computer Society Press, Los Alamitos (2005)

    Google Scholar 

  11. D’Souza, D.F., Wills, A.C.: Objects, Components, and Frameworks with UML: The Catalysis Approach. Addison-Wesley, Reading (1998)

    Google Scholar 

  12. Eisenstadt, M.: My hairiest bug war stories. Communications of the ACM 40(4), 30–37 (1997)

    Article  Google Scholar 

  13. Gamma, E., Helm, R., Johnson, R.E., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1994)

    Google Scholar 

  14. Goldsmith, S., O’Callahan, R., Aiken, A.: Relational queries over program traces. In: Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA), pp. 385–402. ACM Press, New York (2005)

    Google Scholar 

  15. Haas, P.J., Naughton, J.F., Swami, A.N.: On the relative cost of sampling for join selectivity estimation. In: Proceedings of the thirteenth ACM symposium on Principles of Database Systems (PODS), pp. 14–24. ACM Press, New York (1994)

    Chapter  Google Scholar 

  16. Hobatr, C., Malloy, B.A.: The design of an OCL query-based debugger for C++. In: Proceedings of the ACM Symposium on Applied Computing (SAC), pp. 658–662. ACM Press, New York (2001)

    Google Scholar 

  17. Hobatr, C., Malloy, B.A.: Using OCL-queries for debugging C++. In: Proceedings of the IEEE International Conference on Software Engineering (ICSE), pp. 839–840. IEEE Computer Society Press, Los Alamitos (2001)

    Google Scholar 

  18. Ibaraki, T., Kameda, T.: On the optimal nesting order for computing n-relational joins. ACM Transactions on Database Systems 9(3), 482–502 (1984)

    Article  MathSciNet  Google Scholar 

  19. Krishnamurthy, R., Boral, H., Zaniolo, C.: Optimization of nonrecursive queries. In: Proceedings of the ACM Conference on Very Large Data Bases (VLDB), pp. 128–137. Morgan Kaufmann Publishers Inc., San Francisco (1986)

    Google Scholar 

  20. Lencevicius, R.: Query-Based Debugging. PhD thesis, University of California, Santa Barbara, TR-1999-27 (1999)

    Google Scholar 

  21. Lencevicius, R.: On-the-fly query-based debugging with examples. In: Proceedings of the Workshop on Automated and Algorithmic Debugging (AADEBUG) (2000)

    Google Scholar 

  22. Lencevicius, R., Hölzle, U., Singh, A.K.: Query-based debugging of object-oriented programs. In: Proceedings of the ACM conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA), pp. 304–317. ACM Press, New York (1997)

    Chapter  Google Scholar 

  23. Lencevicius, R., Hölzle, U., Singh, A.K.: Dynamic Query-Based Debugging. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 135–160. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  24. Liu, Y.A., Stoller, S.D., Gorbovitski, M., Rothamel, T., Liu, Y.E.: Incrementalization across object abstraction. In: Proceedings of the ACM conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA), pp. 473–486. ACM Press, New York (2005)

    Google Scholar 

  25. Martin, M., Livshits, B., Lam, M.S.: Finding application errors and security flaws using PQL: a program query language. In: Proceedings of the ACM conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA), pp. 365–383. ACM Press, New York (2005)

    Google Scholar 

  26. Mishra, P., Eich, M.H.: Join processing in relational databases. ACM Computing Surveys 24(1), 63–113 (1992)

    Article  Google Scholar 

  27. Noble, J.: Basic relationship patterns. In: Harrison, N., Foote, B., Rohnert, H. (eds.) Pattern Languages of Program Design 4, ch. 6, pp. 73–94. Addison-Wesley, Reading (2000)

    Google Scholar 

  28. Noble, J., Grundy, J.: Explicit relationships in object-oriented development. In: Proceedings of the conference on Technology of Object-Oriented Languages and Systems (TOOLS), Prentice-Hall, Englewood Cliffs (1995)

    Google Scholar 

  29. Pearce, D.J., Noble, J.: Relationship aspects. In: Proceedings of the ACM conference on Aspect-Oriented Software Development (AOSD), pp. 75–86. ACM Press, New York (2005)

    Google Scholar 

  30. Pierik, C., Clarke, D., de Boer, F.: Creational invariants. In: Proceedings of the Workshop on Formal Techniques for Java-like Programs (FTfJP), pp. 78–85 (2004)

    Google Scholar 

  31. Pooley, R., Stevens, P.: Using UML: Software Engineering with Objects and Components. Addison-Wesley, Reading (1999)

    Google Scholar 

  32. Potanin, A., Noble, J., Biddle, R.: Checking ownership and confinement. Concurrency and Computation: Practice and Experience 16(7), 671–687 (2004)

    Article  Google Scholar 

  33. Potanin, A., Noble, J., Biddle, R.: Snapshot query-based debugging. In: Proceedings of the IEEE Australian Software Engineering Conference (ASWEC), pp. 251–261. IEEE Computer Society Press, Los Alamitos (2004)

    Chapter  Google Scholar 

  34. Rustan, K., Leino, M., Müller, P.: Object Invariants in Dynamic Contexts. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 491–515. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  35. Rustan, K., Leino, M., Müller, P.: Modular Verification of Static Class Invariants. In: Fitzgerald, J.S., Hayes, I.J., Tarlecki, A. (eds.) FM 2005. LNCS, vol. 3582, pp. 26–42. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  36. Steinbrunn, M., Moerkotte, G., Kemper, A.: Heuristic and randomized optimization for the join ordering problem. The VLDB Journal 6(3), 191–208 (1997)

    Article  Google Scholar 

  37. Swami, A.N., Iyer, B.R.: A polynomial time algorithm for optimizing join queries. In: Proceedings of the International Conference on Data Engineering, pp. 345–354. IEEE Computer Society Press, Los Alamitos (1993)

    Chapter  Google Scholar 

  38. Warmer, J., Kleppe, A.: The Object Constraint Language: precise modeling with UML. Addison-Wesley Longman Publishing Co., Inc., Boston (1999)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Willis, D., Pearce, D.J., Noble, J. (2006). Efficient Object Querying for Java. In: Thomas, D. (eds) ECOOP 2006 – Object-Oriented Programming. ECOOP 2006. Lecture Notes in Computer Science, vol 4067. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11785477_3

Download citation

  • DOI: https://doi.org/10.1007/11785477_3

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-35726-1

  • Online ISBN: 978-3-540-35727-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics