Best of Awesome Java Newsletter — 2024

  1. 1
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    DESIGN PATTERNS : A Deep Dive into Common Design Patterns

    Design patterns are reusable solutions to common design problems encountered in software development. They offer templates involving classes, interfaces, and relationships between them. Key types of design patterns include Creational, Structural, and Behavioral patterns. Each category provides specific solutions like Singleton, Builder, Factory Method, Adapter, Facade, Iterator, Strategy, and Observer patterns. Examples illustrating how these patterns can be implemented are provided to showcase their practical applications.

  2. 2
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    Java Performance Optimization Techniques

    Optimizing Java code performance is critical, especially considering that most users abandon a page if it takes longer than 3 seconds to load. Key techniques include using Java virtual threads, enabling lazy loading in Hibernate, implementing effective caching strategies, avoiding GenerationType.TABLE due to its performance overhead, and leveraging Hibernate's Query Plan Cache.

  3. 3
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    **🌟 Mastering the Java Collections Framework 🌟**

    The Java Collections Framework provides powerful data structures like Lists, Sets, and Maps, which allow for efficient data storage and manipulation. It offers flexibility with different implementations such as `ArrayList`, `HashSet`, and `HashMap`. Key components include ordered lists, unordered sets, and key-value pair maps. Pro tips include choosing the right collection type, ensuring thread safety, and utilizing Java 8+ features like Streams and Lambda expressions.

  4. 4
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    TreeMap in Java: A Must-Know Data Structure

    TreeMap is a Red-Black tree-based implementation of the NavigableMap interface in Java, maintaining key-value pairs in sorted order. Unlike HashMap, TreeMap does not support null keys and has a time complexity of O(log n) for basic operations. It is ideal for scenarios requiring sorted data and efficient range operations, such as event logging, financial applications, scheduling, version control, caching, leaderboards, and spell checking. Key methods include `put`, `get`, `remove`, navigation methods like `firstKey`, `lastKey`, and range views like `headMap`, `tailMap`, and `subMap`.

  5. 5
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    Everything you need to know about Java 22

    Java 22 has introduced several updates and features including JEPs, underscore usage, String Templates, 'Statements before super()', 'Implicitly Declared Classes', Stream Gatherer interface, G1 garbage collector, Region Pinning, and the Foreign Function & Memory API.

  6. 6
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    Structured logging in Spring Boot 3.4

    Structured logging in Spring Boot 3.4 allows logs to be written in well-defined, machine-readable formats such as JSON. This enables powerful search and analytics capabilities. It supports the Elastic Common Schema (ECS) and Logstash formats and allows for custom formats. Developers can add additional fields to logs for better filtering and analysis. Logs can be output to the console or written to a file for different use cases.

  7. 7
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    How to implement a Distributed Lock using Redis

    Handling critical sections in distributed systems can be complex, especially when multiple instances might update the same database. Implementing distributed locking ensures that only one instance performs a critical operation at any given time. Using Redis, both single-instance and Redlock algorithms provide solutions, although they come with their own challenges, such as handling failover in master-replica setups.

  8. 8
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    The Best Microservices Design Patterns Explained Like You’re Ordering Pizza

    The post creatively explains various microservices design patterns using a pizza-making analogy. It covers essential patterns like Single Responsibility, API Gateway, Database per Service, Circuit Breaker, Event Sourcing, Saga, Strangler, Bulkhead, CQRS, Sidecar, and Backend for Frontend (BFF). Each pattern is described with its benefits and real-life examples to illustrate its practical application in software engineering.

  9. 9
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    Java 101: Zero to Hero Course

    A comprehensive guide to Java programming, covering topics such as data types, control flow, object-oriented programming, exception handling, generics, collections, and concurrency.

  10. 10
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    Why are my JAVA virtual threads slower than the platform threads?

    Exploring the performance differences between Java virtual threads and platform threads, the post highlights how virtual threads can enhance service performance by avoiding idle time during I/O operations. It covers enabling virtual threads in Spring Boot, building a test API for comparison, and performance comparisons using Apache HTTP server benchmarking. The author identifies pinning as the reason for unexpected slowdowns and concludes with strategies for overcoming limitations using MySQL Connector/J.

  11. 11
    Article
    Avatar of java_libhuntAwesome Java Newsletter·1y

    Top 10 IntelliJ IDEA Plugins to Boost Development Efficiency in 2024

    IntelliJ IDEA developers can boost their efficiency using specific plugins designed for various tasks. Key plugins include Apidog Fast Request for API debugging, JetBrains AI Assistant for intelligent code assistance, Lombok for reducing boilerplate code, SonarLint for code quality assurance, Save Actions for automating file save tasks, Key Promoter X for learning keyboard shortcuts, CodeGlance for quick code navigation, Rainbow Brackets for enhanced readability with colored brackets, Translation for real-time code translation, and JRebel for efficient hot deployment.

  12. 12
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    Generating Java Test Data With Instancio

    Manual test data creation in Java can lead to boilerplate code and limited test coverage. Instancio is a Java library designed to automate test data generation with a fluent API, reducing verbosity and enhancing test reliability by incorporating randomized data. Instancio allows customization of fields, exclusion of specific properties, and enables reproducible tests through seed values. It also supports Bean Validation for generating constraint-compliant test data and integrates seamlessly with JUnit and Spring Boot. Instancio simplifies creating JSON request bodies for `@WebMvcTest` and promotes reusable test data templates to further enhance test clarity and maintainability.

  13. 13
    Article
    Avatar of java_libhuntAwesome Java Newsletter·1y

    Quick and Easy: How to Test RESTful APIs in Java

    Testing RESTful APIs is crucial for backend development but switching between IDEs and tools like Postman can reduce efficiency. The Apidog Fast Request plugin for IntelliJ IDEA simplifies this process by enabling API testing directly within the development environment. It supports Java and Kotlin projects, automatically generates API documentation, and syncs endpoint info for team collaboration. Install it from IntelliJ's plugin marketplace for streamlined testing with a single click.

  14. 14
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    50 Java Interview Questions Answers for Practice

    A post providing a list of Java interview questions for experienced Java programmers. The questions cover various topics such as OOP concepts, Java collections, concurrency, and more.

  15. 15
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    Java 23 Launch Stream

    Java 23, released on September 17th, 2024, was celebrated with a 3.5-hour live stream on the Java YouTube channel. The event featured presentations from notable guests and provided insights into Java 23's new features, community updates, and future plans, including previews of updates to GraalVM and Project Leyden. The recording is available on YouTube for those who missed it.

  16. 16
    Article
    Avatar of java_libhuntAwesome Java Newsletter·1y

    Boundary Check vs Try-Catch

    The post compares the performance of two coding approaches: boundary check and try-catch, with code benchmarks. The boundary check approach outperforms try-catch by 22.6% due to the JVM's optimization capabilities and the overhead associated with exception handling. Key factors influencing the results include explicit conditional checks and runtime overhead of exceptions.

  17. 17
    Article
    Avatar of java_libhuntAwesome Java Newsletter·1y

    Z Garbage Collector in Java

    Java applications have diverse performance requirements, such as throughput, latency, and scalability. The Z Garbage Collector (ZGC) is designed to minimize pause times while efficiently managing large heap sizes. Unlike traditional garbage collectors that can cause significant application pauses, ZGC performs most of its work concurrently with the application, achieving minimal interruptions. This makes it ideal for high-demand environments like financial systems and large-scale cloud applications. The article includes a practical comparison between ZGC and G1 GC, showcasing ZGC's superior performance in maintaining low latency.

  18. 18
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    Migrating from Java 8 to Java 17 II: Notable API Changes in Java

    The post highlights notable API changes and enhancements made from Java 8 to Java 17. It covers key improvements introduced in Java 9 such as the module system, new methods for the Stream API, and enhancements in Optional. Subsequent Java versions brought further refinements like local-variable type inference in Java 10, new String and InputStream methods in Java 11, switch expressions starting in Java 12, text blocks in Java 15, records in Java 16, and utilities for hexadecimal binary data representation in Java 17.

  19. 19
    Article
    Avatar of java_libhuntAwesome Java Newsletter·1y

    Clean Code: The Good, the Bad and the Ugly

    Clean Code by Robert C. Martin has had a significant impact on the programming world, emphasizing the importance of code quality, readability, and maintainability. While many of its principles are timeless, the book has been criticized for its heavy Java focus and dogmatic presentation. Modern programming practices and languages have evolved, and there are now better alternatives that provide more nuanced advice. The book's examples, particularly the prime generator, are often verbose and not always aligned with its own rules, making them difficult for beginners to understand.

  20. 20
    Article
    Avatar of java_libhuntAwesome Java Newsletter·1y

    CompletableFuture Example: Crawler

    This post goes beyond trivial examples often used to explain Java's CompletableFuture, by implementing a simple web-crawler that starts at a specific page and follows links to reach a target website. The example uses Java's HttpClient for downloading pages and employs various techniques, including concurrency management, async operations, and recursion, to make the crawler efficient. Additionally, it covers challenges such as memory usage, concurrency limits, and avoiding revisiting pages to create a practical yet insightful example for both beginner and seasoned developers.

  21. 21
    Article
    Avatar of java_libhuntAwesome Java Newsletter·1y

    Five ways to speed up your Maven builds

    Learn five strategies to significantly speed up Apache Maven build times, including the use of profiles, concurrent testing, parallel builds, skipping unnecessary steps, and leveraging build caching. By applying these techniques to a representative project, build time was reduced from 1.5 minutes to 7.5 seconds, freeing up developers to focus more on coding.

  22. 22
    Video
    Avatar of java_libhuntAwesome Java Newsletter·2y

    Java, How Fast Can You Parse 1 Billion Rows of Weather Data? • Roy van Rijn • GOTO 2024

  23. 23
    Article
    Avatar of java_libhuntAwesome Java Newsletter·1y

    Spring Boot 3.4.0 available now

    Spring Boot 3.4.0 has been released. It includes various updates and features, improving the overall performance and user experience. By continuing to use their site, you consent to the use of cookies in accordance with the Cookie Notice.

  24. 24
    Article
    Avatar of java_libhuntAwesome Java Newsletter·1y

    How Much Memory Do You Need in 2024 to Run 1 Million Concurrent Tasks?

    A benchmark comparison in 2024 reveals how different programming languages handle memory consumption for running 1 million concurrent tasks, particularly focusing on coroutines rather than multiple threads. The benchmark highlights significant improvements in .NET with NativeAOT, which is now highly competitive with Rust. Surprisingly, Go's goroutines consumed more memory than expected, while Java's native image built with GraalVM showed efficient memory usage.

  25. 25
    Article
    Avatar of java_libhuntAwesome Java Newsletter·1y

    What’s Brewing in JDK 24

    JDK 24, scheduled for release on March 18, 2025, includes several significant updates and features, like the Class File API, Stream Gatherers, and Flexible Constructor Bodies. Notably, the generational ZGC mode is becoming default, while the String Templates feature has been removed. Improvements include faster application startup with JEP 483 and better handling of primitive types in pattern matching. Updates like Structured Concurrency, simplified imports, and enhanced memory management contribute to developer efficiency. Java is also focusing on future cryptographic needs and removing support for outdated technologies such as the Security Manager and 32-bit systems.