db - 공부하다 얻은 토막지식

Elenaljh·2023년 7월 13일

스프링입문

목록 보기
3/3

1. DAO pattern in java

출처: https://www.baeldung.com/java-dao-pattern

  • Data Access Object pattern
  • a structural pattern that allows us to isolate the application/business layer from the persistence layer (usually a relational database but could be any other persistence mechanism) using an abstract API.

2. The IoC container

출처: https://docs.spring.io/spring-framework/docs/3.2.x/spring-framework-reference/html/beans.html

  • Inversion of Control(IoC) principle = dependency injection (DI)
  • The container injects dependencies when it creates the bean.
  • The org.springframework.beans and org.springframework.context` packages are the basis for Spring Framework's IoC container.

3. thread safe (쓰레드 세이프)

  • 멀티 쓰레드 프로그래밍에서, 어던 공유 자원에 여러 쓰레드가 동시에 접근해도 프로그램 실행에 문제가 없는 상태
  • ex. spring의 JdbcTemplate

4. Stateful (상태유지)

출처: https://inpa.tistory.com/entry/WEB-%F0%9F%93%9A-Stateful-Stateless-%EC%A0%95%EB%A6%AC

  • 클라이언트와 서버 관계에서 서버가 클라이언트의 상태를 보존함을 의미
  • 클라이언트와 서버 간에 송수신을 하며 단계별 과정을 진행하는데 있어, 서버에서 클라이언트가 이전 단계에서 제공한 값을 저장하고 다음 단계에서도 저장한 상태이다
  • ex. 로그인을 하면 페이지를 이동해도 로그인이 풀리지 않는 것
  • 클라이언트의 정보는 브라우저의 쿠키나 서버의 세션 메모리에 저장되어 상태를 유지하게 된다.

5. build.gradle 오류

스크린샷을 찍지는 못했는데 build.gradle에서 dependency를 제대로 추가했는데도 불구하고 패키지 import가 제대로 되지 않고 빌드파일에 다 빨간줄 쳐지고 난리가 났었다.

출처: https://error-fighter.tistory.com/17

  • 발생 원인: 캐시 관련 문제
  • 해결 방안:
    인텔리제이 상단 -> File -> Invalidate Caches / Restart -> Invalidate Caches and Restart 클릭

6. MyBatis vs JPA

0개의 댓글