Compact constructor는 입력을 검증하고 snapshot으로 바꾼 뒤 저장한다

원본 List를 그대로 보관하면 record 생성 뒤 외부 변경이 value의 hash와 내용까지 바꿉니다.

  1. 1

    constructor input

    title·viewCount·tags

  2. 2

    validate

    null·범위 거부

  3. 3

    normalize

    trim·표준 단위

  4. 4

    snapshot

    List.copyOf(tags)

  5. 5

    implicit assignment

    final components 저장

핵심: implicit field assignment 전에 정규화된 매개변수를 방어 복사하면 모든 생성 경로가 같은 불변식을 통과합니다.