Identify and apply data-oriented programming best practices in Java to improve code clarity, maintainability, and predictability by strictly separating data structures from behavior and ensuring all data transformations are explicit, pure, and traceable.
Core areas: Records for immutable data carriers over mutable POJOs, data-behavior separation with pure static utility classes holding operations, pure functions for data transformation that depend only on inputs and produce no side effects, flat denormalized data structures with ID-based references over deep nesting, generic Map representations for dynamic schemas converted to specific types when needed, Optional...
Prerequisites: Run ./mvnw compile before applying any changes. If compilation fails, stop immediately — do not proceed until the project compiles successfully.
레코드를 사용하여 데이터 구조에서 코드(동작) 분리, 순수 변환 함수로 불변 데이터 설계, ID 기반 참조로 데이터를 플랫하게 유지하고 비정규화, 필요할 때 특정 유형으로 변환하는 일반 데이터 구조로 시작, 순수 검증 기능을 통해 데이터 무결성 보장, 유연한 일반 데이터 액세스 레이어 생성 등 Java에서 데이터 지향 프로그래밍 모범 사례를 적용해야 할 때 사용합니다. Skills-for-Java 프로젝트의 일부 출처: jabrena/cursor-rules-java.