서버프로그램 구현난도 중상
4번 · 주관식 · 5점
다음 코드의 RecordService와 FileStore는 모두 Store 추상화에 의존한다. 이 구조에 가장 직접적으로 적용된 SOLID 원칙의 명칭과 저장 구현을 교체할 때의 효과를 쓰시오.
interface Store {
void save(String value);
}
class FileStore implements Store {
public void save(String value) { /* 파일 저장 */ }
}
class RecordService {
private final Store store;
RecordService(Store store) {
this.store = store;
}
void add(String value) {
store.save(value);
}
}