github.com/yegor256/cactoos

Object-Oriented Java primitives, as an alternative to Google Guava and Apache Commons

Open this visualization on its own page →

Contributors

98

Lines of Code

9,997

From

2017-05-23

To

2021-02-06

About yegor256/cactoos

Cactoos is a Java library providing object-oriented alternatives to procedural utilities found in the JDK, Google Guava, and Apache Commons. Instead of static utility methods, Cactoos implements functionality through composable objects and interfaces, adhering to principles of elegant object design. The library requires Java 17 or later and ships with zero runtime dependencies.

The project covers a wide range of common programming tasks across input/output operations, text and string manipulation, collections processing, functional operations, and date/time handling. All core functionality is built on a small set of functional interfaces like Scalar, Text, Func, Input, Output, Bytes, and Proc. Key architectural patterns include lazy evaluation by default, the Decorator pattern for adding capabilities like caching and thread safety, and the Envelope pattern for safe inheritance that prevents the fragile base class problem.

Cactoos is designed for developers who prefer composition and object-oriented design over procedural programming. The library emphasizes immutability, first-class handling of checked exceptions, and explicit control over evaluation and caching. It's particularly suitable for projects where dependency management and code clarity matter, offering a dependency-free alternative that maintains functional composability without sacrificing object-oriented principles.

Share this video