Hey #Java Developers,

It's your Friday #SipOfJava thread! 🧢🐈

Records are one of the most important new language features added to Java in recent releases and are central to Java's story on Data Oriented Programming. Let's take a look at how to use Records!

1/7
Let's first understand what Records are, and how they can be very helpful when handling data transformation within a method's body!

2/7
Serialization causes a lot of headaches within Java. Because of the constraints imposed on Records, Records address many of the pain points of Serialization in Java. Let's see how.

3/7
Serialization libraries are also starting to support Records, allowing for easy serializing and deserializing of Records over mediums like HTTP and as messages. Let's look at how three popular libraries support Records.

4/7
Because Records are immutable, they will never be an option for entities in JPA. They however can be a great option for JPA projections. Let's look at how to accomplish that.

5/7
Here are three more helpful tips to make the most out of using Records in your applications.

6/7
Happy coding!

7/7

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Billy Korando β˜•οΈ 🐈 🐈 #BLM

Billy Korando β˜•οΈ 🐈 🐈 #BLM Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @BillyKorando

Jul 1
Hey #Java Developers, β˜•οΈ

It's your Friday #SipOfJava thread! 🧢🐈

Needing to communicate with a remote service? Let's take a look at some features and APIs in Java that help with communicating with remote services!

1/
The HTTP Client added in #JDK11 improves and replaces the HttpUrlConnection, by supporting standards likes HTTP/2 and WebSocket and allowing requests to be sent synchronously and asynchronously

Article: inside.java/sip/057/

2/
Unix-Domain Socket Channels added in #JDK16 allow for fast and secure communication between Java applications when they are located on the same host. And despite their name, even work on windows!

Article: inside.java/sip/010/

3/
Read 7 tweets
Jun 24
Hey #Java Developers, β˜•οΈ

Here's your Friday #SipOfJava thread! 🧢🐈

Improving performance or reducing memory footprint is important to reducing the cost of running Java applications, especially when using public cloud platforms. Here are some ways to accomplish this!

1/7
Often the best choice would be to upgrade to the latest JDK version, which provides significant runtime benefits.

inside.java/sip/008

2/7
Here is a bit deeper look at some of the runtime improvements to the JDK in recent releases.

inside.java/sip/051

3/7
Read 7 tweets
May 27
Hey #Java developers, β˜•οΈ

Here is your Friday #SipOfJava thread! 🧢🐈

Needing to automate a task? Consider writing it in Java! Recent changes, and some long-existing APIs, have made Java a practical choice for writing small utility apps. Let's take a look!

1/7
Added in JDK 11, the java launcher can now directly launch single-file source-code applications. Making it easier to develop and launch small utility apps.

Article: inside.java/sip/003/

2/7
Local-variable type inference (var) was added in JDK 10. var can make it easier when working with complex types (i.e. when generics are involved) and easier to define variables in applications.

3/7
Read 7 tweets
May 6
Hey #Java developers, β˜•οΈ

It's your Friday #SipOfJava thread! 🧡

Records πŸ’Ώ are one of the most exciting changes that have come to Java since Lambdas and Streams in Java 8. Let's review some of the key benefits and library integrations for Records.

1/6
Sometimes during data transform a data type is only needed with context of a single method. Local Records allow a data type to be defined as a single line within a method.

2/6
Serialization is one of the scariest areas in Java, with a lot of easy to overlook traps that could leave your application vulnerable. Records address a lot of common serialization vulnerabilities.

3/6
Read 7 tweets
Apr 22
Hey #Java Developers, β˜•οΈ

It's your #SipOfJava Friday thread! 🧡

String is one of the most often utilized JDK classes by Java developers. Let's take a look at how String has been improved in recent Java releases, as well as some over looked features from older releases.

1/7
Text Blocks were added in Java 15, and introduce the concept of a 2-dimensional String. Text Blocks greatly improve the experience of working with markup languages like; XML, JSON, HTML, as Strings.

2/7
The String classes has seen a lot of work done to it since JDK 8, with many new helper methods being added. Check out this Sip of Java were I cover some of the key new additions.

3/7
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(