Efficient Object Querying for Java

  • Darren Willis
  • David J. Pearce
  • James Noble
Part of the Lecture Notes in Computer Science book series (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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    The Standard Performance Corporation. SPEC JVM98 benchmarks (1998), http://www.spec.org/osg/jvm98
  2. 2.
    Baker, H.G.: Iterators: Signs of weakness in object-oriented languages. ACM OOPS Messenger 4(3) (July 1993)Google Scholar
  3. 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)CrossRefGoogle Scholar
  4. 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)CrossRefGoogle Scholar
  5. 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)CrossRefGoogle Scholar
  6. 6.
    Booch, G., Jacobson, I., Rumbaugh, J.: The Unified Modeling Language User Guide. Addison-Wesley, Reading (1998)Google Scholar
  7. 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. 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. 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. 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. 11.
    D’Souza, D.F., Wills, A.C.: Objects, Components, and Frameworks with UML: The Catalysis Approach. Addison-Wesley, Reading (1998)Google Scholar
  12. 12.
    Eisenstadt, M.: My hairiest bug war stories. Communications of the ACM 40(4), 30–37 (1997)CrossRefGoogle Scholar
  13. 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. 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. 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)CrossRefGoogle Scholar
  16. 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. 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. 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)CrossRefMathSciNetGoogle Scholar
  19. 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. 20.
    Lencevicius, R.: Query-Based Debugging. PhD thesis, University of California, Santa Barbara, TR-1999-27 (1999)Google Scholar
  21. 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. 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)CrossRefGoogle Scholar
  23. 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)CrossRefGoogle Scholar
  24. 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. 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. 26.
    Mishra, P., Eich, M.H.: Join processing in relational databases. ACM Computing Surveys 24(1), 63–113 (1992)CrossRefGoogle Scholar
  27. 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. 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. 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. 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. 31.
    Pooley, R., Stevens, P.: Using UML: Software Engineering with Objects and Components. Addison-Wesley, Reading (1999)Google Scholar
  32. 32.
    Potanin, A., Noble, J., Biddle, R.: Checking ownership and confinement. Concurrency and Computation: Practice and Experience 16(7), 671–687 (2004)CrossRefGoogle Scholar
  33. 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)CrossRefGoogle Scholar
  34. 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)CrossRefGoogle Scholar
  35. 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)CrossRefGoogle Scholar
  36. 36.
    Steinbrunn, M., Moerkotte, G., Kemper, A.: Heuristic and randomized optimization for the join ordering problem. The VLDB Journal 6(3), 191–208 (1997)CrossRefGoogle Scholar
  37. 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)CrossRefGoogle Scholar
  38. 38.
    Warmer, J., Kleppe, A.: The Object Constraint Language: precise modeling with UML. Addison-Wesley Longman Publishing Co., Inc., Boston (1999)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Darren Willis
    • 1
  • David J. Pearce
    • 1
  • James Noble
    • 1
  1. 1.Computer ScienceVictoria University of WellingtonNZ

Personalised recommendations