Table of Contents
Fetching ...

Embracing Objects Over Statics: An Analysis of Method Preferences in Open Source Java Frameworks

Vladimir Zakharov, Yegor Bugayenko

TL;DR

This study scrutinizes the runtime behavior of 28 open-source Java frameworks using the YourKit profiler to reveal a predominant use of instance methods and constructors over static methods, suggesting that developers still favor an object-oriented approach, despite its potential drawbacks.

Abstract

In today's software development landscape, the extent to which Java applications utilize object-oriented programming paradigm remains a subject of interest. Although some researches point to the considerable overhead associated with object orientation, one might logically assume that modern Java applications would lean towards a procedural style to boost performance, favoring static over instance method calls. In order to validate this assumption, this study scrutinizes the runtime behavior of 28 open-source Java frameworks using the YourKit profiler. Contrary to expectations, our findings reveal a predominant use of instance methods and constructors over static methods. This suggests that developers still favor an object-oriented approach, despite its potential drawbacks.

Embracing Objects Over Statics: An Analysis of Method Preferences in Open Source Java Frameworks

TL;DR

This study scrutinizes the runtime behavior of 28 open-source Java frameworks using the YourKit profiler to reveal a predominant use of instance methods and constructors over static methods, suggesting that developers still favor an object-oriented approach, despite its potential drawbacks.

Abstract

In today's software development landscape, the extent to which Java applications utilize object-oriented programming paradigm remains a subject of interest. Although some researches point to the considerable overhead associated with object orientation, one might logically assume that modern Java applications would lean towards a procedural style to boost performance, favoring static over instance method calls. In order to validate this assumption, this study scrutinizes the runtime behavior of 28 open-source Java frameworks using the YourKit profiler. Contrary to expectations, our findings reveal a predominant use of instance methods and constructors over static methods. This suggests that developers still favor an object-oriented approach, despite its potential drawbacks.
Paper Structure (8 sections, 5 figures, 3 tables)

This paper contains 8 sections, 5 figures, 3 tables.

Figures (5)

  • Figure 1: Java program that uses procedural approach, focuses on simple computations using static methods without utilizing of any objects.
  • Figure 2: Java program that uses object-oriented approach, performing the same computations as the program of \ref{['fig:procedural-simple-sample']}, but emphasizing high objects usage through the Decorator Pattern.
  • Figure 3: Bytecode for the "procedural" Java program of \ref{['fig:procedural-simple-sample']}, where some less relevant lines were removed for the sake of brevity.
  • Figure 4: Bytecode for the object-oriented Java program of \ref{['fig:oop-simple-sample']}, where some less relevant lines and constructors were removed for the sake of brevity.
  • Figure 5: Histogram of methods distribution: percentage of constructors, static methods, and instance methods across 28 analyzed frameworks. Blue indicates various types of instance methods, yellow and orange represent static methods, green denotes constructors, and black indicates methods that are generated at runtime and for which the type could not be determined.