Published Sep 3, 2019

SE-Radio Episode 316: Nicolai Parlog on Java 9

Discover the transformative impact of Java 9 with Nicolai Parlog, as he delves into its new Module System, evolutionary changes since Java 8, and key features like default method enhancements that aim to revolutionize dependency management and streamline coding practices.
Episode Highlights
Software Engineering Radio - the podcast for professional software developers logo

Popular Clips

Episode Highlights

  • Default Methods

    Java 9 introduces significant enhancements to default methods in interfaces, allowing for private methods. explains that this change enables code sharing between default methods without exposing them as part of the public API 1. This is a departure from Java 8, where all default methods were public, potentially cluttering the API. The ability to include private methods within interfaces allows developers to maintain cleaner and more secure codebases.

    Java 9 now allows private interface methods, which is just a regular private method like in any other class.

    ---

    This enhancement is particularly beneficial for developers looking to streamline their code while maintaining backward compatibility 2.

       

    Language Enhancements

    Java 9 also brings other language enhancements such as improvements to the try-with-resources statement and the diamond operator. highlights that these changes reduce boilerplate code, making Java more efficient and user-friendly 3. The try-with-resources enhancement allows developers to manage resources more effectively without unnecessary assignments, while the diamond operator now supports anonymous classes, simplifying code syntax.

    In Java 7, I had to assign that variable. It had to be an assignment in there. There was a good reason for that.

    ---

    These updates reflect Java's ongoing commitment to improving developer experience by minimizing repetitive coding tasks.

       

    Encapsulation

    Encapsulation in Java 9 has been enhanced to provide more robust control over code visibility across modules. discusses how these changes allow developers to define smaller, more secure interfaces between modules, reducing the risk of unintended access 4. This is achieved by projecting encapsulation principles onto the level of jars, which were previously not possible.

    It gives us the freedom to declare surfaces that are smaller, particularly across jars.

    ---

    These enhancements encourage better software design by enforcing stricter access controls, ultimately leading to more maintainable and reliable applications.

Related Episodes