목록2022/08/06 (2)
Developer_Neo
AOP란? Aspect Oriented Programming(관점 지향 프로그래밍)이다. 여러 객체에 공통적으로 적용할 수 있는 기능을 따로 정의해서, 다른 객체에 삽입해 코드의 재사용성을 높여주는 프로그래밍 기법 공통 관심 사항과 핵심 관심 사항으로 나뉘어지는데, 핵심 관심사항은 우리가 해왔던 회원 가입, 회원 조회등에 해당하고, 공통 관심 사항은 모든 메서드들에 대해 시간 측정하는 것으로 볼 수 있다. 공통 관심 사항을 핵심 관심 사항으로만 되어 있는 곳에 일일이 코드로 다 작성을 하게 된다면, 매우 번거롭다. 이에 공통 관심사항과 핵심 관심사항을 분리하기 위해 사용하는 것이 AOP이다. 즉, 코드들을 보았을 때 공통적으로 존재하는 코드들은 공통 관심 사항으로 분리해, 원하는 곳에 AOP로 적용할 수..
스프링 데이터 JPA란? JPA를 한 단계 더 추상화 시켜 개발 용이성을 상당히 올려주는 인터페이스 JPA말고 스프링 데이터 JPA를 사용하면, 리포지토리의 인터페이스만으로(구현 클래스 없이) 개발을 완료 할 수 있다. 반복 개발해온 기본 CRUD 기능도 스프링 데이터 JPA가 모두 제공해서 코드를 적을 것이 없다. Spring Data JPA는 Repository라는 인터페이스를 제공합니다. 이 Repository는 정해진 규칙으로 인터페이스를 선언하기만 해도 자동으로 내부에서 구현체를 만들어 동작시켜줍니다. 특히 자주 사용하는 매서드들(findAll(), save(), delete() 등...)은 별도로 선언하지 않아도 사용 할 수 있습니다. 우리는 이전의 글에서 JPA를 사용하였고, JpaMembe..