Best of Foojay.ioOctober 2024

  1. 1
    Article
    Avatar of foojayioFoojay.io·2y

    Book Review: Mastering the Java Virtual Machine

    Otávio Santana's 'Mastering the Java Virtual Machine' offers an in-depth exploration of JVM internals, combining nostalgic elements of Java programming with modern concepts. The book covers JVM architecture, performance optimization, class file structure, bytecode operations, memory management, JIT compilation, garbage collection, alternative JVMs like GraalVM, and advanced topics such as Java frameworks, reflection API, and code generation. It's an essential resource for Java developers aiming to improve their understanding and efficiency in Java development.

  2. 2
    Article
    Avatar of foojayioFoojay.io·2y

    Builder Pattern Simplicity with JEP-455 Primitive Types

    JDK 23 introduces JEP-455, which simplifies the usage of primitive types within the builder design pattern. This enhancement reduces the necessity of verbose typecasting, making the code more readable and maintainable. The builder pattern is highlighted as being more flexible and testable compared to the factory pattern, especially with the advanced operations facilitated by JEP-455. The local variable type inference provided by JEP-286 also enhances code clarity during the object creation process.

  3. 3
    Article
    Avatar of foojayioFoojay.io·2y

    Null object pattern to avoid null pointer exception with JEP-455

    JDK 23 introduces critical enhancements with JEP-455, which extends pattern matching to include primitive types in switch and instanceof statements. This update aligns Java more closely with functional programming paradigms. The null object pattern is highlighted as a method to avoid null pointer exceptions, illustrated using a vehicle sensor cache scenario. These changes promote better code maintainability and improved program execution speed.