Skip to content
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

[JDBC 라이브러리] 효오 미션 제출합니다. #33

Merged
merged 34 commits into from
Oct 20, 2019

Conversation

hyojaekim
Copy link

@hyojaekim hyojaekim commented Oct 17, 2019

안녕하세요! 영재님

이번에 jdbc 미션을 진행하면서 그 동안 자바 기능을 많이 활용하지 못했다고 느꼈고, 자바에 대해 다시 학습할 수 있는 기회였습니다.

많은 지적 부탁드리겠습니다!

(try-with-resources 구문에 대한 중복은 어떻게 제거해야 할지 모르겠네요...)

Copy link

@young891221 young891221 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안녕하세요 효오! 리뷰어 하비입니다.
기본적으로 잘 짜주셨네요. 💯
살짝 리펙토링 포인트가 보여 몇 가지 개선 포인트를 남겨보았습니다.
확인해 보시고 답변이나 반영 부탁드립니다:)

this.dataSource = dataSource;
}

public T queryForObject(String sql, PreparedStatementSetter pstmtSetter, RowMapper<T> rowMapper) throws SQLException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반환값이 Optional이면 외부에서 사용하기 한결 더 편리해 보입니다.

return query(sql, pstmtSetter, rowMapper).get(0);
}

public List<T> query(String sql, PreparedStatementSetter pstmtSetter, RowMapper<T> rowMapper) throws SQLException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

query(), update() 메서드에 중복 코드가 존재합니다. 인터페이스를 구현하여 할당 시키는 부분만 다른데요. 중복코드 제거해서 하나로 통일할 수 잇지 않을까요?ㅎㅎ

import java.sql.SQLException;

@FunctionalInterface
public interface PreparedStatementSetter {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

import java.sql.SQLException;

@FunctionalInterface
public interface RowMapper<T> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link

@young891221 young891221 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

피드백 반영을 잘해주셨습니다 👍
미션 진행하느라 고생하셨습니다 :)

@young891221 young891221 merged commit 87d8cf4 into woowacourse:hyojaekim Oct 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants