--- kind: CONCEPT slug: adapter-outbound-cache-redis-c08 title: 한쪽에만 적용되는 변경이 구조적으로 불가능하다 topic: state-machines-and-ownership project: clean-architecture-backend-template status: 게시 전 sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916 rootTreeNode: concept:adapter-outbound-cache-redis-c08 evidenceCapturedOn: 2026-09-01 assets: - key: adapter-outbound-cache-redis-c08 file: ../../../final/evidence/rendered/adapter-outbound-cache-redis-c08.svg - key: adapter-outbound-cache-redis-c08-diagram file: ../../../final/assets/diagrams/adapter-outbound-cache-redis-c08.svg evidence: - ../../../final/evidence/raw/adapter-outbound-cache-redis-c08.txt source: - 원본 분석 절은 analysis/10-adapter-outbound-cache-redis.md#L456 이다. module: adapter-outbound-cache-redis --- # 한쪽에만 적용되는 변경이 구조적으로 불가능하다 `ValueOperationRequests`의 javadoc이 불변식을 적고, 두 구현이 같은 builder를 생성자에서 만들면서 그것을 구조로 보장한다. ## 본문 `ValueOperationRequests`의 javadoc이 불변식을 적는다 — "Both the blocking and the reactive string operations call exactly these methods, so **a change to a permit, a budget, an encoding, or a command choice cannot apply to one API and not the other.**" ## 두 모델이 공유하는 빌더 :::evidence key="adapter-outbound-cache-redis-c08-diagram" alt="공유 request builder 에서 동기 표면과 반응형 표면으로 각각 화살표가 나가고 화살표에 같은 요청 객체가 붙은 구조" caption="두 모델이 공유하는 빌더" zoom="false" ::: 구조가 그것을 보장한다. `LettuceRedisValueOperations`와 `LettuceReactiveRedisValueOperations`는 둘 다 생성자에서 `new ValueOperationRequests(gateway, context, counters)`를 만들고, 차이는 `SyncRedisCommandExecutor` vs `ReactiveRedisCommandExecutor` 하나뿐이다. ## ValueOperationRequests 참조 위치 :::evidence key="adapter-outbound-cache-redis-c08" alt="코드베이스에서 ValueOperationRequests 를 검색한 출력 10줄. 이 기록이 세는 참조가 그 출력에 그대로 보인다." caption="ValueOperationRequests 코드베이스 검색 — 10줄 · exit 0" zoom="true" ::: ## 열한 계열 전부에서 확인했다 각 메서드는 `executor.execute(requests.xxx(...))` 한 줄이고, reactive 쪽은 그 위에 `flatMap`/`then` 같은 형태 변환만 얹는다. Value·Hash·List·Set·SortedSet·Key·Geo·Bitmap·Stream·HyperLogLog·PubSub 모두 sync와 reactive 양쪽이 같은 `*OperationRequests`를 생성한다(`162-...` §8.2).