💡 Java: Records are not limited to data only, you can add custom constructors or methods for validation.
✅ They can have constructors, static methods, and instance methods:
#Java#JavaDev
🚀 Spring Boot: Spring Data JPA has a built-in support for pagination with Pageable.
✅You should use pagination in your repositories instead of fetching all.
#SpringBoot#JavaDev
Java Tip💡: Starting from Java 14 you can use "record" to create short, immutable, data-carrying objects.
✅ They are shorter than ordinary POJOs
✅ They have built-in equals(), hashCode(), toString()
✅ They are immutable by default
#Java#JavaDev
🚀 Spring Boot: You can enable /actuator/beans to debug missing beans.
By hitting the actuator endpoint, you will see information like:
✅ Bean name
✅ Bean type
✅ Bean scope
✅ Bean dependencies
#SpringBoot#JavaDev
💡Java: Use Deque instead of Stack for LIFO (last-in, first-out) lists.
✅ Stack is a legacy class, it extends Vector and synchronizes every operation
✅ Deque supports the same push, pop, peek calls
✅ ArrayDeque is faster than Stack
#JavaDev
🚀 Spring Boot: It has built-in support for pagination with Pageable.
✅You should use pagination in your repositories instead of fetching all.
#SpringBoot#JavaDev
Spring Batch makes ETL tasks easy to manage.
Just define jobs, steps, and chunks — and it handles everything else.
It also manages transactions, retries, and job status by default.
#DevLife#JavaDev#SpringBatch#ayshriv
🚀 Java: A very interesting library by named Sift, replaces the cryptic, string-based approach of the Java Regex engine with a fluent API.
#Java#JavaDev
🧵A link to the GitHub project to follow
🚀 JUnit 5 Tip 🚀
Since JUnit 5, leverage package-private visibility for classes and methods to enhance encapsulation in your tests. This helps keep your testing logic close to the code it's testing while maintaining a clean and organized codebase.
#JUnit#Testing#JavaDev
Java tip💡: If you have a list of elements, you want to remove duplicates, and sort them in natural order or by a custom comparator, you can use TreeSet.
#Java#JavaDev
🚀 Spring Boot: A webhook is when another system sends a POST request to your app when something happens. In Spring Boot, you implement it simply by exposing an endpoint that receives that POST request.
#SpringBoot#JavaDev