-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
메서드의 파라미터 타입을 추상화 타입으로 변경 #6
Conversation
shine-17
commented
Dec 15, 2024
- 메서드의 파라미터 타입을 추상화 타입으로 변경
- service에서 mapper 제거 및 repository에서 mapper를 이용한 객체 변환 수행
- 헝가리안 표기법 제거
service에서 mapper 제거 및 repository에서 mapper를 이용한 객체 변환 수행
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
소소한 코멘트는 적당히 검토해주시고, 승인 먼저 가겠습니다 ㅎ
this.bookMapper = bookMapper; | ||
} | ||
|
||
public static Map<Long, BookEntity> books = new HashMap<>(){{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
개인적으론 이전 방식도 좋았습니다 ㅎㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이전 방식이 books의 타입이 <Long, Book> 이었던 코드를 말씀하시는 건가요?! 테스트 객체지만 추후에 DB와는 Entity로 주고받기 때문에 미리 느낌을 보려고 변경해봤습니다 ㅎㅎ
import java.util.List; | ||
|
||
public interface BookService { | ||
// 도서 조회 (id) | ||
Book findById(long bookId); | ||
|
||
// 도서 목록 조회 (id list) | ||
List<Book> findByIdList(List<Long> bookIdList); | ||
List<Book> findByIdList(Collection<Long> bookIds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
메서드 명도 같이 변경하면 좋겠네요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드를 변경하면서 메서드명을 보고도 아무생각없이 지나쳤던 제 자신을 반성합니다... 😥