Skip to content

refactor: @Bean 메서드의 불필요한 public 접근제어자 제거#57

Open
LeeBaekHaeng wants to merge 2 commits into
eGovFramework:mainfrom
itcen-entec-2026:refactor/problems/EgovConfigAspect
Open

refactor: @Bean 메서드의 불필요한 public 접근제어자 제거#57
LeeBaekHaeng wants to merge 2 commits into
eGovFramework:mainfrom
itcen-entec-2026:refactor/problems/EgovConfigAspect

Conversation

@LeeBaekHaeng

Copy link
Copy Markdown
Contributor

수정 사유 Reason for modification

소스를 수정한 사유가 무엇인지 체크해 주세요. Please check the reason you modified the source. ([X] X는 대문자여야 합니다.)

  • 버그수정 Bug fixes
  • 기능개선 Enhancements
  • 기능추가 Adding features
  • 기타 Others

수정된 소스 내용 Modified source

검토자를 위해 수정된 소스 내용을 설명해 주세요. Please describe the modified source for reviewers.

이유

  • Spring Framework 5.2 이상에서는 @bean 메서드가 반드시 public일 필요가 없습니다.
  • 패키지 접근자(package-private)를 사용하면 불필요한 API 노출을 줄일 수 있습니다.
  • 캡슐화 향상 및 정적 분석 규칙 준수.

JUnit 테스트 JUnit tests

테스트를 완료하셨으면 다음 항목에 [대문자X]로 표시해 주세요. When you're done testing, check the following items.

  • JUnit 테스트 JUnit tests
  • 수동 테스트 Manual testing

테스트 브라우저 Test Browser

테스트를 진행한 브라우저를 선택해 주세요. Please select the browser(s) you ran the test on. (다중 선택 가능 you can select multiple) [X] X는 대문자여야 합니다.

  • Chrome
  • Firefox
  • Edge
  • Safari
  • Opera
  • Internet Explorer
  • 기타 Others

http://localhost:8080/

테스트 스크린샷 또는 캡처 영상 Test screenshots or captured video

테스트 전과 후의 스크린샷 또는 캡처 영상을 이곳에 첨부해 주세요. Please attach screenshots or video captures of your before and after tests here.

image

https://youtu.be/-CTUAIpZTyQ

@eGovFrameSupport

Copy link
Copy Markdown
Contributor

표준프레임워크에 대한 지속적인 참여에
대단히 감사드립니다.

@bean 메서드는 컨테이너가 호출하는 것이지 애플리케이션 코드가 직접 호출하는 대상이 아니므로, 외부 접근이 필요 없는
경우 public을 생략한 package-private이 더 적절한 기본값이라는 제안 취지는 적절하다고 보입니다.

다만 PR 제목("@bean 메서드의 불필요한 public 접근제어자 제거")이 특정 클래스로 한정되어 있지 않은 데 비해, 실제 변경은
EgovConfigAspect 한 클래스에만 적용되어 있습니다. 나머지 config 클래스의 @bean 메서드는 여전히 public으로 남아 있습니다.

이대로 병합하면 한 클래스만 package-private, 나머지는 public인 혼재 상태가 되어, 특히 학습용 레퍼런스 샘플로서
일관성이 떨어집니다.

제안하신 방향이 옳은 만큼, 동일 기준을 모든 config 클래스의 @bean 메서드에 일관되게 적용해 주시면
샘플 전체가 하나의 컨벤션으로 정리되어 더 좋겠습니다.

범위를 맞춰 주시면 이어서 검토하겠습니다. 감사합니다.

@LeeBaekHaeng

LeeBaekHaeng commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

모든 config 클래스의 @bean 메서드의 불필요한 public 접근제어자 제거했습니다.

https://youtu.be/aIBfYdx8hGI

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.

2 participants