Best of JavaAugust 2024

  1. 1
    Article
    Avatar of bytebytegoByteByteGo·2y

    EP125: How does Garbage Collection work?

    Garbage collection is a crucial automatic memory management feature used in many programming languages. Java offers multiple garbage collectors tailored to different scenarios, Python employs reference counting alongside a cyclic collector to handle circular references, and GoLang utilizes a concurrent mark-and-sweep garbage collector to minimize application pauses. Additional topics include tools for designing fault-tolerant systems and key system design trade-offs.

  2. 2
    Video
    Avatar of youtubeYouTube·2y

    Making a Game with Java with No Experience

    An enthusiastic developer, inspired by childhood favorites like RuneScape and Minecraft, embarks on creating an RPG game using Java from scratch. The journey begins with revisiting Java basics using a mobile course and then downloading Eclipse. After a successful 'Hello World' program, the developer progresses to creating a game window, implementing entity classes, and developing a tile map system. They also work on NPCs, dialogue systems, artwork, and basic game mechanics, emphasizing the rewarding experience of building a game without a game engine. Useful resources like RN’s Java tutorial series and Brilliant are mentioned for those interested in learning more.

  3. 3
    Article
    Avatar of javarevisitedJavarevisited·2y

    Which Programming Books Would You Buy If you got 100$ to Spend?

    A community discussion on which programming books to buy with a $100 budget, highlighting popular and timeless recommendations like 'Clean Code', 'Effective Java', and 'Algorithm Design Manual'. The post encourages sharing personal choices and provides a rundown of frequently suggested books, including those on algorithms, design patterns, and system design.

  4. 4
    Article
    Avatar of javarevisitedJavarevisited·2y

    Top 5 Websites to Learn Spring Framework in Depth

    Spring Framework is a popular tool in the Java ecosystem for building robust and scalable applications. To help learners, the post lists five websites that offer comprehensive Spring tutorials and courses: Udemy, Spring Framework Official Documentation, Baeldung, Java Brains, and Spring Framework Guru. These platforms provide resources for both beginners and advanced developers, covering topics from dependency injection to Spring Boot, AOP, and data access.

  5. 5
    Article
    Avatar of itnextITNEXT·2y

    CQRS — Command Query Responsibility Segregation — A Java, Spring, SpringBoot, and Axon Example

    This post introduces Command Query Responsibility Segregation (CQRS) and explains its benefits in software architecture, including its ability to handle different loads for read and write operations, manage security concerns, and maintain data consistency. It provides a practical example using Java, Spring, SpringBoot, and Axon, demonstrating how to implement CQRS with separate databases for command and query operations. Key components like commands, queries, models, EventHandlers, and CommandBus are detailed, alongside dependencies and database configuration.

  6. 6
    Article
    Avatar of game_developersGame Developers·2y

    How to become a Game Developer?

    An individual shares their journey from playing video games to studying game development in college, seeking advice on the key skills and knowledge required to become a game developer. They have basic knowledge of C/C++ with OOP concepts and are learning Data Structures and Algorithms, as well as some Java and Python basics.

  7. 7
    Article
    Avatar of inside_javaInside Java·2y

    Common I/O Tasks in Modern Java

    This post covers common I/O tasks in modern Java, especially in web applications. It discusses reading and writing text files, working with ZIP files, creating temporary files or directories, and highlights the significant API improvements since Java 8. Key points include the default shift to UTF-8 in Java 18, and the obsolescence of certain older classes like java.io.File in favor of java.nio.file.Files and other newer classes.

  8. 8
    Article
    Avatar of baeldungBaeldung·2y

    Changing Spring Boot Properties at Runtime

    Discover how to dynamically manage Spring Boot application configurations at runtime using various methods. Learn about creating prototype-scoped beans, utilizing Spring Cloud's @RefreshScope and /actuator/refresh endpoint, and managing external configuration files. These techniques allow for on-the-fly changes without restarting the application, providing flexibility and enhancing maintainability.

  9. 9
    Article
    Avatar of baeldungBaeldung·2y

    Data Oriented Programming in Java

    This post introduces Data-Oriented Programming (DOP) and contrasts it with Object-Oriented Programming (OOP). It highlights the principles of DOP such as separating data from logic, using immutable data structures, and maintaining data in a valid state. The post includes a practical exercise implementing the game Yahtzee using modern Java features like records, sealed interfaces, and pattern matching. Key distinctions between DOP and OOP are discussed, with examples illustrating the implementation and modeling of data and behavior separately.

  10. 10
    Article
    Avatar of javarevisitedJavarevisited·2y

    Iterator Design Pattern Java

    The Iterator Design Pattern in Java is a behavioral pattern that simplifies the traversal of collections by decoupling the traversal logic from the actual collection. It promotes code reusability, abstraction, and allows custom traversal methods, offering better control over the iteration process.

  11. 11
    Article
    Avatar of javarevisitedJavarevisited·2y

    Most popular Java frameworks for web development

    Java remains a popular programming language for web development due to its scalability, security, and reliability. Several frameworks like Java Server Faces (JSF), Spring, Google Web Toolkit (GWT), Hibernate, Struts, Grails, Dropwizard, Blade, and Play stand out for their unique features and capabilities. These frameworks help developers build structured, secure, and efficient applications, with some focusing on rapid development and ease of use, while others offer robust support for enterprise-level applications.

  12. 12
    Article
    Avatar of devtoDEV·2y

    Introducing AutoMQ: a cloud-native replacement of Apache Kafka

    AutoMQ is a cloud-native replacement for Apache Kafka, designed to address the evolving needs of modern data architectures with a focus on efficiency, scalability, and cost-effectiveness. Originating from a team of open-source pioneers, it offers a unique architecture that decouples storage and computation, leveraging cloud storage to provide significant cost savings and operational efficiency. AutoMQ maintains full compatibility with Kafka, supports multi-cloud environments, and aims to integrate stream data into data lakes to enhance data access and break down silos. The growing community and successful funding highlight its potential impact on the stream storage industry.

  13. 13
    Article
    Avatar of infoworldInfoWorld·2y

    JDK 23: The new features in Java 23

    Java Development Kit (JDK) 23, set for release on September 17, will feature previews of module import declarations, stream gatherers, structured concurrency, and scoped values. Notably, string templates have been dropped. JDK 23 will also bring enhancements such as a new functional interface for scoped values, deprecation of certain memory-access methods in `sun.misc.Unsafe`, and a generational mode default for the Z Garbage Collector. Furthermore, it includes updates to the vector API, Markdown documentation comments, and primitive types in patterns, `instanceof`, and `switch`.

  14. 14
    Article
    Avatar of javarevisitedJavarevisited·2y

    Java Reactive Programming: Everything You Need to Know

    Java Reactive Programming focuses on creating scalable and responsive applications that effectively handle concurrent and asynchronous functions. Utilizing libraries like Project Reactor, Reactive Streams, and RxJava, this paradigm allows developers to manage data streams and events asynchronously, applying operators for non-blocking data transformation and processing. Reactive programming is beneficial for developing modern applications due to its non-blocking nature, composability of data streams, and real-time event handling. However, it can be memory-intensive, challenging to learn, and suffers from limited educational resources.

  15. 15
    Article
    Avatar of javarevisitedJavarevisited·2y

    Creating Locally-Running LLM Chatbot using Java and Spring Boot

    Learn how to create a locally-running chatbot using a pre-trained LLM model with Java and Spring Boot. The tutorial guides you through using the llama.cpp library ported to Java and setting up necessary components like the model and prompt, as well as handling the chatbot's main service. Detailed code snippets are provided for a comprehensive understanding.

  16. 16
    Article
    Avatar of baeldungBaeldung·2y

    Best Practices for Sizing the JDBC Connection Pool

    Efficiently managing database connections using a JDBC connection pool is crucial for application performance. By maintaining a pool of reusable connections, applications can save time and resources. Deciding the optimal pool size involves balancing performance and resource utilization. Factors such as transaction response time, database query duration, and load testing results should be considered. Key settings to tune include initial, minimum, and maximum pool sizes, idle timeout, connection timeout, and transaction isolation levels. Following best practices for tuning these settings ensures robust and efficient database connectivity.

  17. 17
    Article
    Avatar of baeldungBaeldung·2y

    Java Virtual Machine Tutorials

    Java applications often face slow startup and warmup times. The CRaC project from OpenJDK addresses this by creating a performance checkpoint and restoring the JVM at that point. BellSoft offers optimized containers for Java applications, packaging Alpaquita Linux and Liberica JDK, enabling easy integration of CRaC in Spring Boot applications.

  18. 18
    Article
    Avatar of lobstersLobsters·2y

    Don't write Rust like it's Java

    The post discusses the author's journey of adapting from Java to Rust, highlighting key differences and challenges. The author emphasizes Rust's memory safety and type correctness and contrasts Rust's traits with Java's interfaces. The author urges not to force Rust into an object-oriented paradigm and to embrace Rust's unique features and idioms for a more fulfilling development experience.

  19. 19
    Article
    Avatar of frontendmastersFrontend Masters·2y

    Java Optionals – Frontend Masters Boost

    Null references in programming are notorious for causing errors, often referred to as the 'billion dollar mistake.' Java introduced an Optional type to address this issue, providing a safer way to handle variables that might be null. By using methods like Optional.empty(), Optional.of(), and Optional.ofNullable(), developers can avoid null reference exceptions. The post also covers effective ways to use Optionals, such as ifPresent(), ifPresentOrElse(), and flatMap(), highlighting how these approaches make the code safer and more readable.

  20. 20
    Article
    Avatar of justjavaJust Java·2y

    what is Spring Security for real 🤔

    Spring Security is a powerful framework for securing Java applications, handling authentication and authorization. It protects against vulnerabilities like CSRF and XSS, offers customizable security policies, and integrates seamlessly with other Spring projects. Features include security context propagation, custom authentication providers, method-level security, and configuring security headers for enhanced protection. A real-world example shows how to secure a RESTful API with role-based access.

  21. 21
    Article
    Avatar of baeldungBaeldung·2y

    DDD with jMolecules

    Learn how to leverage jMolecules to express Domain-Driven Design (DDD) concepts using annotations and type-based interfaces. The post covers key DDD elements such as Value Objects, Entities, Aggregate Roots, and Repositories, and demonstrates how to use jMolecules for building a domain model of a blogging application. It also explains how to integrate jMolecules with popular Java and Spring libraries and enforce DDD principles using ArchUnit.

  22. 22
    Article
    Avatar of hnHacker News·2y

    Common I/O Tasks in Modern Java

    Highlights common I/O tasks in modern Java, including reading and writing text files, handling directories and ZIP files, and creating temporary files. Emphasizes API improvements since Java 8 such as UTF-8 default encoding and enhancements to classes like java.nio.file.Files. Provides practical code examples for various tasks and advises against using outdated classes like java.io.File.

  23. 23
    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.

  24. 24
    Article
    Avatar of itnextITNEXT·2y

    Hexagonal Architecture — A Favorite Lyrics Spring Boot — Java Example

    Hexagonal Architecture, introduced by Alistair Cockburn in 2005, aims to mitigate issues in object-oriented programming through Ports and Adapters. It separates application components into three parts: core (business logic), primary ports and adapters (driving interaction), and secondary ports and adapters (interfacing with external systems). This example demonstrates managing a lyrics storage system using Spring Boot, JPA for persistence, and an H2 in-memory database. The architecture ensures clear separation between business logic and external dependencies, promoting interchangeability and modularity.

  25. 25
    Article
    Avatar of communityCommunity Picks·2y

    11 Non-AI Java Trends: From GraalVM to Spring Modulith

    Java developers are showcasing interest in several non-AI trends. These include GraalVM for improving runtime efficiency, Data-Oriented Programming (DOP) for treating data as first-class citizens, the debate between Quarkus and Spring Boot, in-depth details of Spring Internals, Kotlin integration with Spring Boot, and security improvements with Spring Security 3 and OAuth2. Additionally, discussions focus on the benefits of Spring Data JDBC, alternatives to Thymeleaf templates, the evolving Spring Modulith architecture, enhanced runtime efficiency with virtual threads and CRaC in Java 21, and observability improvements introduced in Spring Boot 3.2 and 3.3.