Chapter 9. Data classes and their usage
Work is in progress on data classes under the Project Amber. It proposes to bring to developers a simplified way of modelling data as data, by introducing special classes with the keyword record. The state of the data class would be able to be captured using the class header, which is in stark contrast to what the existing Plain Old Java Objects (POJO) offer at present.
In the chapter, we'll cover the following topics:
- An introduction to the data classes
- Need of the data classes and their limitations
- Aggregate and exploded form of a data class
- Pattern matching with data classes
- Inheritance with abstract data classes and interfaces
- Adding variables and methods
- Overriding default behavior