In this Engineering With Java newsletter edition, we have hand-picked some interesting Java and Spring articles worth reading. Topics include Hibernate soft deletion, GraphgQL & Spring Boot, Reactor, Validation, NoSQL with JPA, etc.
If you're preparing for interviews, I have some good news! I’ve started a LinkedIn page called "Interview Prep 101," where I post intriguing interview questions related to DSA, Java, Spring Boot, and SQL. If you're interested, feel free to follow the page!
Thanks for your support always!
1. Hibernate SoftDelete annotation
The article provides a practical guide to implementing soft deletion in Hibernate using a custom
@SoftDelete
annotation.It highlights the benefits of soft deletion, such as data recovery and auditing, and offers a step-by-step approach to applying this technique in Hibernate applications.
By defining a custom annotation and implementing the necessary logic, developers can effectively manage soft deletions while retaining historical data and meeting compliance requirements.
2. Converting Data Sources to Streams
The article advocates for refactoring traditional Java code to use streams where appropriate.
By leveraging the
Stream
API, developers can write more declarative and functional-style code that is often more concise and easier to understand.It emphasizes the benefits of streams, such as better readability and potential parallelism, while also noting that performance should be considered and code complexity assessed
3. GraphQL with Spring Boot for Efficient APIs
The article provides a practical guide to integrating GraphQL with Spring Boot, highlighting its benefits for building efficient APIs.
By leveraging GraphQL's powerful querying capabilities and Spring Boot's ease of setup, developers can create more flexible and performant APIs.
The guide covers essential steps including schema definition, resolver implementation, and testing, making it a comprehensive resource for adopting GraphQL in Spring Boot applications.
4. Using Reactor Mono.cache() for Memoization In Spring
The article provides a practical guide to using Reactor's
Mono.cache()
operator for memoization in Spring applications.By leveraging caching with
Mono
, developers can optimize performance and resource usage by avoiding redundant computations and improving efficiency.The article covers the implementation details, advantages of memoization, and considerations for using caching effectively in reactive applications.
5. Master URL Validation with Java
The article provides practical approaches for URL validation in Java, including the use of
URL
andURI
classes, regular expressions, and third-party libraries like Apache Commons Validator.It emphasizes the importance of validating URLs to ensure correctness and reliability in applications.
Developers can use these techniques to effectively handle URL validation and integrate reliable URL processing into their Java applications.
🚀 Grokking the Java Interview 🚀
Crack your Java interview by preparing important topics and mastering key concepts in a guided and structured way in a short time.
6. Integrating Java Enums with JPA and PostgreSQL Enums
The article provides a detailed guide on integrating Java enums with PostgreSQL enums and JPA.
It covers defining enums in both Java and PostgreSQL, mapping them using JPA annotations, and handling conversions with custom attribute converters.
The approach ensures type safety, consistency, and effective data management between Java applications and PostgreSQL databases.
7. Generating HTTP clients in Spring Boot application from OpenAPI spec
The article provides a step-by-step guide on how to generate and use an OpenAPI client in a Spring Boot application.
By leveraging OpenAPI Generator, developers can automate the creation of client code that interacts with REST APIs, ensuring consistency and improving development efficiency.
The process involves preparing an OpenAPI specification, generating the client code, and integrating it into a Spring Boot application, with considerations for configuration and customization.
8. Introduction to Polymorphism With Database Engines in NoSQL Using Jakarta NoSQL
The article provides an overview of how polymorphism can be implemented and managed in NoSQL databases.
It discusses how different NoSQL database engines—document stores, key-value stores, column family stores, and graph databases—handle polymorphic data structures.
The flexibility of NoSQL databases makes them suitable for polymorphic scenarios, offering advantages in handling diverse data types while highlighting considerations for data integrity and query complexity.
9. Why OOP Is a Bad Fit for Custom Software
The article argues that while Object-Oriented Programming (OOP) has its merits, it may not always be the best fit for custom software development. OOP can introduce complexity and overhead that might not be justified for every project.
Alternative paradigms like Functional Programming, Procedural Programming, and Data-Oriented Design may offer simpler or more effective solutions depending on the project’s specific requirements.
The choice of programming paradigm should be context-driven, aligning with the needs and goals of the software being developed.
10. @ExtensionMethod Annotation in Lombok
The article provides an overview of the
@ExtensionMethod
annotation from Project Lombok, which facilitates adding extension methods to existing classes in Java.By using this annotation, developers can enhance the functionality of classes without altering their original code, leading to cleaner and more maintainable code.
However, it is important to use extension methods judiciously to maintain code readability and avoid potential conflicts.
🚀 Ace Your Next System Design Interview 🚀
Taught by a best-selling author, everything you need to take your system design skills to the next level.