전체 글474 NVM 설치 프론트 개발하다 보면 각 프로젝트마다 node 버전이 다른경우 버전을 맞춰주지 않으면 예상치 못한 버그가 발생할 수 있는데, 그것을 대비하여 각 프로젝트에서 사용되는 버전을 NVM을 통하여 node 버전을 맞춰서 개발 할 수 있다. 설치 전에 만약 node가 설치되어있다면 제어판에서 삭제 후 진행 해 준다.터미널에서 node 명령어로 확인 아래 사이트에서 exe 파일을 다운 받아 준다. 설치 사이트:https://github.com/coreybutler/nvm-windows/releases Releases · coreybutler/nvm-windowsA node.js version management utility for Windows. Ironically written in Go. - coreybut.. 2024. 7. 21. 현재 브라우저 활성화 여부 체크 방법 https://developer.mozilla.org/ko/docs/Web/API/Document/visibilityState#%EB%AA%85%EC%84%B8%EC%84%9C Document.visibilityState - Web API | MDN Document.visibilityState 읽기 전용 property로, 이 element가 현재 표시된 컨텍스트를 나타내는 document의 가시성을 반환합니다. document가 background 또는 보이지 않는 탭(다른 탭)에 있는지, 또는 pre-rendering을 developer.mozilla.org document.addEventListener("visibilitychange", () => { console.log(document.visib.. 2024. 4. 4. AOP AOP가 필요한 상황 모든 메소드의 호출 시간을 측정하고 싶을 때 핵심관심사항: 서비스 로직 공통관심사항: 각 서비스 로직 메소드가 얼마나 걸리는지 구한다. 직접 구하는 방법 public Long join(Member member) { // 메소드 수행시간을 구한다는 과정에서의 코드 long start = System.currentTimeMillis(); try { // 중복회원 검증 validateDuplicateMember(member); memberRepository.save(member); return member.getId(); } finally { long finish = System.currentTimeMillis(); long times = finish - start; System.out... 2022. 8. 24. 스프링 데이터 JPA 스프링 데이터 JPA는 JPA를 편리하게 사용하도록 도와주는 기술이기 때문에 먼저 JPA를 먼저 익혀야 한다. 앞의 JPA 설정을 그대로 사용한다. SpringDataJpaMemberRepository 인터페이스 생성 인터페이스는 다중 상속이 가능하다. 스프링 데이터 JPA사용을 위해서 JpaRepository 를 상속 받는다. JpaRepository를 사용하면 스프링 데이터 JPA가 인터페이스에 대한 구현체를 만들어서 자동으로 빈 등록 해준다. package hello.hellospring.repository; import hello.hellospring.domain.Member; import org.springframework.data.jpa.repository.JpaRepository; impor.. 2022. 8. 23. JPA JPA는 기존의 반복코드와 SQL문을 직접 만들어준다. JPA를 사용하면, SQL과 데이터 중심의 설계에서 객체 중심의 설계를 할 수 있다. build.gradle 디펜던시 수정 - jdbc 주석 처리 and jpa 추가 // implementation 'org.springframework.boot:spring-boot-starter-jdbc' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' application.properties 수정 # jpa 작성된 쿼리를 확인 할 수 있도록 설정 spring.jpa.show-sql=true # 자동 테이블 생성기능 끄기 spring.jpa.hibernate.ddl-auto=none jp.. 2022. 8. 22. 스프링 JDBC Template 환경설정은 순수 JDBC 설정과 동일하게 하면 된다. 순수 JDBC에서 작성한 반복 코드를 제거해준다. 실무에서 많이 사용된다고 한다. 공식 문서 https://docs.spring.io/spring-framework/docs/current/reference/html/data-access.html#jdbc-JdbcTemplate Data Access The Data Access Object (DAO) support in Spring is aimed at making it easy to work with data access technologies (such as JDBC, Hibernate, or JPA) in a consistent way. This lets you switch between the a.. 2022. 8. 19. 이전 1 2 3 4 5 6 ··· 79 다음