Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[21기_최근호] spring tutorial 미션 제출합니다. #13
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
base: WithFortuna
Are you sure you want to change the base?
[21기_최근호] spring tutorial 미션 제출합니다. #13
Changes from 1 commit
0ce4919
4299fd5
f1e100a
c3a3355
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
싱글톤 객체의 설명을 보고 static 클래스와 spring bean의 차이점이 궁금해서 찾아보았는데 잘 설명되어있는 것 같아 첨부합니다~
싱글톤 vs 정적클래스
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.
어떤 추가 설정이 가능한가요?
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.
저는 해당 부분을 조사할 때
@Retention
어노테이션의 기능이 헷갈렸어서, 혹시나 참고하시라고 제가 참고했던 글 남깁니다. 블로그의 댓글에 어떤 분이 잘 설명해주신 것 같아요.retention어노테이션
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.
RetentionPolicy.CLASS는 저도 이게 굳이 왜 필요한지 이해가 잘 안갔었는데 덕분에 배워갑니다 👍
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.
BeanFactory와 BeanDefinitionRegistry
의 관계를 잘 정리해주셨는데, Spring에서는 일반적으로ApplicationContext
를 더 많이 사용한다고 합니다.BeanFactory
와ApplicationContext
의 차이는 무엇일까요?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.
코드 예시 들어주신거 너무 좋은데요?
GenericApplicationContext
가 직접getBean()
을 호출하지 않고, 내부적으로DefaultListableBeanFactory
에 위임하는 이유는 무엇인가요?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.
오 질문이 날카롭습니다..
GenericApplicationContext
가 직접getBean()
함수를 구현하지 않고 별도의 구현체인DefaultListableBeanFactory
를 멤버변수로 두고 사용하는 방식이 저도 낯설더라고요.일단 몇가지 이유를 찾아봤는데
:
ApplicationContext(AC)
는 여러 상위 기능을 한꺼번에 제공해야합니다. 따라서 직접 구현하거나 상속하는 방식을 택한다면 AC가 너무 많은 책임을 지게 됩니다.: 새로운 빈팩토리가 필요하면 멤버변수를 교체만 하면 됩니다. 또 국제화와 같은 상위기능을 더하고 싶을 때에도 멤버로 추가하거나 빈으로 등록만 하면 되므로 확장하기가 쉽습니다!
보통 조합과 위임이라고 표현하는 것 같습니다