In this chapter, we covered the challenges of using POJOs to model data. We covered how data classes provide a simple and concise way to model data. Implementation of data classes will include language changes, with the introduction of the record keyword. The main goal of using data classes is to model data as data, not to reduce the boilerplate code.
We also covered the aggregate and exploded forms of data classes. The data classes can be used with other language constructs, such as switch. By default, the data classes are not mutable, including the arrays defined as the data members. Since these structures are not immutable, a developer must include code to ensure thread safety when working with them.
In the next chapter, you'll learn more about an exciting language enhancement—raw string literals. Does this mean a pure, or untouched, string? Find out for...