2021.05.31 ~06.01 기록장
To Do
- 기능 구현, 리팩터링, pr 보내기
- 책 읽기
- 북마크 정리
Done
- pr 보내기
- 책 읽기
Weekly goal
- 책 읽기
- 블로그 읽기
Feeling
oauth를 구현하면서 만난 문제점은 enum 초기화 시점에 id를 주입받으려 한 점이다.
GetPropertyUtil은 applicationContext에서 property를 가져올 수 있다.
문제는 static이다 보니 생성 순서에 문제가 생겼다.
static이 먼저인가 bean 등록이 먼저인가? 스프링 주입 전에 static이 메모리에 올라감으로 null 예외가 나왔었다.
https://stackoverflow.com/questions/46538728/which-one-gets-loaded-first-static-block-or-spring-bean
Which one gets loaded first? static block or spring bean?
I am autowiring an object of with spring and I am calling a method using the same autowired object. It is throwing NullPointerException. The problem is that I am calling the method inside a static ...
stackoverflow.com
https://stackoverflow.com/questions/17659875/autowired-and-static-method
@Autowired and static method
I have @Autowired service which has to be used from within a static method. I know this is wrong but I cannot change the current design as it would require a lot of work, so I need some simple hack...
stackoverflow.com
https://ixtears23.github.io/ApplicationContextAware/
ApplicationContextAware
ixtears23.github.io
@Bean과 @component
https://jojoldu.tistory.com/27
@Bean vs @Component
Spring으로 개발을 하다보면 @Bean과 @Component를 언제 써야할지 헷갈릴때가 있다. 둘다 목적이 명확하지 않은 Bean을 생성할때 사용하는 어노테이션인데 왜 2개로 나누어져있나 궁금했었는데, 박재성
jojoldu.tistory.com
bean 등록 순서 라이프 사이클, 컴포넌트부터 스캔으로 읽고 @bean을 읽는다
https://n1tjrgns.tistory.com/257
[Spring] Bean LifeCycle
솔직하게 말해서 기존에는 LifeCycle이 왜 중요한지 체감을 못했다. 단순히 중요하다니까 보는정도? 하지만, JPA를 공부하다보니 Entity의 LifeCycle이 엄청 중요했다. 그래서 LifeCycle에 대한 공부를 하
n1tjrgns.tistory.com
https://zion830.tistory.com/112
[스프링 부트 개념과 활용] 자동 설정 (Auto Configuration)
인프런에서 백기선님의 스프링 부트 개념과 활용을 수강하고 개인적으로 공부한 내용을 정리한 글입니다. 자동 설정의 개요 스프링 프로젝트가 실행되는 지점인 메인 어플리케이션의 기본적인
zion830.tistory.com
object 4 챕터에서 본 내용이다. 캡슐화는 변할 수 있는 어떤 것이라도 감추라는 것이다. 클래스에서의 상태들을 get으로 노출시킬 경우 , 나중에 변경되면 사이드 이펙트가 발생한다.
처음 이 부분을 읽었을 때는 심하다고 생각했지만 1 챕터에 보여준 객체지향을 잘 지킨 예제를 보니 어느 것도 노출시키지 않았다. 그저 메시지를 받을 때 처리할 메서드만 노출시키는 것이다.
내 코드에는 get을 활용한 로직이 몇 개 있는데, 이 부분을 나중에 고쳐봐야겠다.