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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
The Standard Performance Corporation. SPEC JVM98 benchmarks (1998), http://www.spec.org/osg/jvm98
Baker, H.G.: Iterators: Signs of weakness in object-oriented languages. ACM OOPS Messenger 4(3) (July 1993)
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)
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)
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)
Booch, G., Jacobson, I., Rumbaugh, J.: The Unified Modeling Language User Guide. Addison-Wesley, Reading (1998)
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)
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)
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)
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)
D’Souza, D.F., Wills, A.C.: Objects, Components, and Frameworks with UML: The Catalysis Approach. Addison-Wesley, Reading (1998)
Eisenstadt, M.: My hairiest bug war stories. Communications of the ACM 40(4), 30–37 (1997)
Gamma, E., Helm, R., Johnson, R.E., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1994)
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)
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)
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)
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)
Ibaraki, T., Kameda, T.: On the optimal nesting order for computing n-relational joins. ACM Transactions on Database Systems 9(3), 482–502 (1984)
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)
Lencevicius, R.: Query-Based Debugging. PhD thesis, University of California, Santa Barbara, TR-1999-27 (1999)
Lencevicius, R.: On-the-fly query-based debugging with examples. In: Proceedings of the Workshop on Automated and Algorithmic Debugging (AADEBUG) (2000)
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)
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)
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)
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)
Mishra, P., Eich, M.H.: Join processing in relational databases. ACM Computing Surveys 24(1), 63–113 (1992)
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)
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)
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)
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)
Pooley, R., Stevens, P.: Using UML: Software Engineering with Objects and Components. Addison-Wesley, Reading (1999)
Potanin, A., Noble, J., Biddle, R.: Checking ownership and confinement. Concurrency and Computation: Practice and Experience 16(7), 671–687 (2004)
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)
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)
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)
Steinbrunn, M., Moerkotte, G., Kemper, A.: Heuristic and randomized optimization for the join ordering problem. The VLDB Journal 6(3), 191–208 (1997)
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)
Warmer, J., Kleppe, A.: The Object Constraint Language: precise modeling with UML. Addison-Wesley Longman Publishing Co., Inc., Boston (1999)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)