> Markdown version of [/videos/387-using-java-17-latest-features-in-real-world-projects](https://www.wearedevelopers.com/videos/387-using-java-17-latest-features-in-real-world-projects). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Using Java 17 latest features in real world projects With Spring Boot 3 enforcing Java 17, upgrading is no longer optional. Discover how records, sealed classes, and pattern matching natively eliminate boilerplate and secure your real-world applications. - **Speakers:** [Ron Veen](https://www.wearedevelopers.com/@ron-veen) - **Event:** World Congress 2022 - **Published:** June 15, 2022 - **Duration:** 30:28 - **URL:** https://www.wearedevelopers.com/videos/387-using-java-17-latest-features-in-real-world-projects ## Summary Java 17 represents a significant leap forward in the language's evolution, introducing a suite of modern features designed to natively reduce boilerplate and enhance code reliability. Tracing the enhancements from Java 12 up to the current long-term support release, the presentation unpacks five core concepts: switch expressions, text blocks, records, sealed classes, and pattern matching. While each feature offers isolated benefits, their true power emerges holistically. For example, switch expressions synchronize seamlessly with sealed classes to enable exhaustive type checking without relying on default fallback statements, resulting in significantly cleaner domain logic. Beyond syntactic convenience, these updates fundamentally shift how Java manages data structures and system security. Records provide concise, immutable data carriers that restrict malicious reflection during REST API deserialization, ensuring runtime construction remains strictly validated through compact constructors. Furthermore, pattern matching consolidates type verification and variable extraction into an intuitive two-stage process that guards against common null pointer errors. Adopting these features is rapidly transitioning from optional to critical, as major frameworks like Spring Boot 3 now enforce Java 17 as a strict baseline. Despite certain architectural limitations—such as records lacking compatibility with JPA's zero-argument constructor requirements—Java's willingness to integrate best-in-breed paradigms from languages like Kotlin ensures its massive enterprise ecosystem remains robust, secure, and developer-friendly. **Keywords:** java 17 features, switch expressions, text blocks, java records, compact constructors, sealed classes, pattern matching, immutable data carriers, API deserialization security, exhaustive type checking, spring boot baseline, JPA record limitations, JVM garbage collection, java object inheritance, modern language evolution ## Chapters 1. **Reviewing modern Java features from version 12 to 17** (00:00) — Anticipating structured concurrency in newer versions provides context for adopting mature language features from recent long-term support releases. 1. **Using switch expressions to return values directly** (01:47) — Replacing the classic switch statement with structured expressions removes boilerplate return calls and forces exhaustive outcome mapping. 1. **Managing multiline strings securely with text blocks** (04:32) — Adopting triple-quoted text blocks removes the need for complex string concatenation and automatically manages intentional formatting whitespace. 1. **Creating immutable data carriers using Java records** (07:46) — Declaring immutable data structures via records generates essential methods automatically and enhances serialization security by enforcing constructor-based initialization. 1. **Restricting object inheritance hierarchy using sealed classes** (13:39) — Specifying permitted subclasses via sealed and non-sealed modifiers gives compilers complete visibility into class inheritance trees. 1. **Extracting variables via instance pattern matching techniques** (17:36) — Applying pattern matching predicates directly evaluates object types and extracts them into variables without requiring subsequent manual casting. 1. **Integrating new language features for readable async code** (21:56) — Combining sealed interfaces, records, and pattern matching refactors complex error-handling scenarios into highly readable and exhaustive switch statements. 1. **Addressing framework compatibility and overall language evolution** (24:14) — Evaluating framework dependencies like Spring Boot and JPA limitations clarifies the practical integration landscape alongside general garbage collector optimizations. ## Related Moments - [Choosing Java 17 for modern Spring Boot applications](https://www.wearedevelopers.com/videos/383-kubernetes-native-java) (from "Kubernetes Native Java") - [Major language and productivity upgrades from Java 12 to 17](https://www.wearedevelopers.com/videos/658-beam-me-up-java-unraveling-the-warp-speed-evolution-a-journey-through-java-lts-versions-11-to-21) (from "Beam Me Up, Java! Unraveling the Warp-Speed Evolution: A Journey through Java LTS Versions 11 to 21") - [Migrating applications from Java 11 to Java 17](https://www.wearedevelopers.com/videos/344-what-s-new-for-developers-moving-from-java-11-to-17) (from ""What´s New for Developers Moving from Java 11 to 17?"") - [Significant performance and language features launching in Java 21](https://www.wearedevelopers.com/videos/658-beam-me-up-java-unraveling-the-warp-speed-evolution-a-journey-through-java-lts-versions-11-to-21) (from "Beam Me Up, Java! Unraveling the Warp-Speed Evolution: A Journey through Java LTS Versions 11 to 21") - [Discussing modern Java language evolution and syntax innovations](https://www.wearedevelopers.com/videos/344-what-s-new-for-developers-moving-from-java-11-to-17) (from ""What´s New for Developers Moving from Java 11 to 17?"") - [Overview of the Java features presentation](https://www.wearedevelopers.com/videos/105-best-of-java-15-and-beyond-my-favorite-features) (from "Best of Java 15 and beyond—my favorite features") ## Related Articles - [Using Java 17 latest features in real world projects](https://www.wearedevelopers.com/magazine/121-using-java-17-latest-features-in-real-world-projects) - [Modern Java Records](https://www.wearedevelopers.com/magazine/41-modern-java-records) - [Modern Java Switch Expressions](https://www.wearedevelopers.com/magazine/40-modern-java-switch-expressions) - [Java Basics](https://www.wearedevelopers.com/magazine/122-java-basics) ## Related Jobs - [Senior Software Developer Java (m/w/d)](https://www.wearedevelopers.com/jobs/39654-senior-software-developer-java-m-w-d) at **Sopra Steria Custom Software Solutions GmbH** - [Senior Software Engineer](https://www.wearedevelopers.com/jobs/ext/15942-senior-software-engineer) at **GitHub** - [Senior Backend Engineer (Java)](https://www.wearedevelopers.com/jobs/ext/19369-senior-backend-engineer-java) at **Bonial International GmbH** - [(Senior) Java Software-Entwickler](https://www.wearedevelopers.com/jobs/48140-senior-java-software-entwickler) at **Finanz Informatik** - [Senior Software Engineer, Enterprise Products](https://www.wearedevelopers.com/jobs/ext/1841248-senior-software-engineer-enterprise-products) at **GitHub** - [Principal Software Engineer](https://www.wearedevelopers.com/jobs/ext/149130-principal-software-engineer) at **Twilio**