getter를 사용하는 대신 객체에 메시지를 보내자.
https://tecoble.techcourse.co.kr/post/2020-04-28-ask-instead-of-getter/
‘자바 빈 설계 규약’에 따르면
객체지향 프로그래밍은 객체가 스스로 일을 하도록 하는 프로그래밍이다. getter는 그 객체가 일을 하는게 아니다. 로직을 갖고 있는 형태도 아니고, 커뮤니케이션이 일어나지도 않는다.
→ 객체스럽지 못하다
<추가 정보> 디미터 법칙 : 객체간의 연결이 길어질수록 불안정해진다. (train werck)
Collection 인터페이스를 사용하는 경우 외부에서 getter 메서드로 얻은 값을 통해 상태값을 변경할 수 있다.
→ Collections.unmodifiableList()와 같은 Unmodifiable Collection을 사용해 외부에서 변경하지 못하도록 하는 것이 좋다.
https://tecoble.techcourse.co.kr/post/2020-05-07-appropriate_method_for_test_by_parameter/
1장 도메인 모델 시작 - Incheol's TECH BLOG (gitbook.io)
map, trim, max, compareTo, get
junit5 @Nested 계층구조로 테스트코드 작성하기 (tistory.com)
[Java] 정규표현식 사용법 및 예제 - Pattern, Matcher (tistory.com)
알고보니 Null 값은 ==로 하면 안되고, Objects.equals 로 해주어야 한다!!
attempt나 예외 처리부분 재시작 기능은 어떻게 구현하지?
bridgeNumberGenerator 부분 테스트는 어떻게 해야할까? 나중에 리펙토링해보자.
https://www.slipp.net/questions/557