2022-04-07-TIL

Today I Learned

ResponseEntity

  • https://stackoverflow.com/questions/22725143/what-is-the-difference-between-responseentityt-and-responsebody
  • https://stackoverflow.com/questions/49673660/return-responseentity-vs-returning-pojo
  • https://kobumddaring.tistory.com/27
  • https://junior-datalist.tistory.com/222
  • https://2ham-s.tistory.com/279

CORS Errors

  • https://developer.mozilla.org/ko/docs/Web/HTTP/CORS/Errors
  • https://evan-moon.github.io/2020/05/21/about-cors/

Spring Data Rest

스프링부트에서 REST API를 매우 간단하게 자동으로 만들어주는 의존 라이브러리가 있다. 이 라이브러리는 HATEOAS형태로 API를 레파지토리에서 바로 뽑아준다. 하지만 당장 실무에서 적용하기는 어려울 것 같다. 결국엔 많은 부분을 커스텀해야할 것 같기 때문이다. (프론트엔드와의 연동 호환성 유지 등의 이유로 인해)

  • https://www.baeldung.com/spring-data-rest-intro
  • https://supawer0728.github.io/2018/03/20/spring-data-rest/
  • https://brunch.co.kr/@purpledev/30

모듈형 모노리스

자바 프로젝트는 자바 클래스 < 패키지 < 모듈 로 구성되는데, 일반적으로 모듈은 자바 프로젝트 하나와 대응된다. 하지만 하나의 큰 프로젝트 안에 여러개의 모듈을 포함시킬 수 있다. 이는 자세히 보면 마이크로 서비스 아키텍처와는 그 구조가 다르다. MSA의 경우 도커파일 등 설정 파일이 있어서 각각 도커라이징해서 다른 포트로 서비스를 띄우도록 되어있다. 하지만 모듈형 모노리스 서버는 하나의 서버인데 모듈 파일만 나누어 놓았을 뿐이다.

  • https://github.com/arawn/building-modular-monoliths-using-spring
  • https://www.youtube.com/watch?v=SrQeIz3gXZg

Maven groupId. artifactId, version

  • https://junghn.tistory.com/entry/SPRINGMaven-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-groupId-artifactId-version-%EC%9D%B4%EB%9E%80

REST API and HATEOAS

  • https://blog.devmountain.com/what-is-the-difference-between-rest-and-restful-apis
  • https://dev-coco.tistory.com/97
  • https://techdocs.broadcom.com/us/en/symantec-security-software/identity-security/advanced-authentication/9-1/building/rest-based-api/ca-risk-authentication-rest-api/hateoas-usage-in-the-rest-apis.html
  • https://gmlwjd9405.github.io/2018/09/21/rest-and-restful.html
  • https://wonit.tistory.com/454
  • https://www.youtube.com/watch?v=RP_f5dMoHFc
  • https://joomn11.tistory.com/26

CrudRepository vs JpaRepository

  • https://www.tutorialspoint.com/difference-between-crudrepository-and-jparepository-in-java
  • https://stackoverflow.com/questions/14014086/what-is-difference-between-crudrepository-and-jparepository-interfaces-in-spring

@EnableConfigurationProperties

@Component 애너테이션 없이 빈으로 등록되는 것들은 내부적으로 어떻게 동작하는 것인가?

  • https://www.baeldung.com/spring-enable-config-properties
  • https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/context/properties/EnableConfigurationProperties.html

@Component

  • https://www.baeldung.com/spring-component-annotation

@Value

  • https://www.baeldung.com/spring-value-annotation