JWT (JSON Web Token) 안전하게 전송하기 위해 고안된 JSON 객체의 데이터 (key-value) JSON 은 key와 value로 이루어진 데이터 객체이다. JWT 는 이 JSON 객체를 이용한 Token 이라는 것을 통해 유저를 식별하고 유효성 검사를 수행한다. Filter 디스패처 서블릿(Dispatcher Servlet)에 요청이 전달되기 전에 수행. 웹 컨테이너에 의해 관리. Interceptor 디스패처 서블릿(Dispatcher Servlet)이 컨트롤러를 호출하기 전에 수행. 스프링 컨텍스트에서 동작. 위의 2가지 방법 중에서 원하는 방식을 선택하여 사용하면 된다. 이 Token 에는 header, payload, signature 를 담고 있고, payload 에는 secr..
다형성이란?polymorphism (다형성)a word or phrase that is used with another word or phrase to limit or add to its meaning그 의미를 제한하거나 더하기 위해 다른 단어나 구와 함께 사용되는 단어나 구다형성List list = new ArrayList();Map map = new HashMap();다른 타입으로 객체 생성조상클래스 타입의 참조변수로 자손클래스의 인스턴스를 참조할 수 있는 것다형성의 조건1. 상속 관계일 것class AirConditional {}class SmartTv extends Tv{ }class Tv { }class Main { public static void main(String[] args) { ..
한 눈에 알아보고 읽을 수 있어야 한다. @RestController @RequiredArgsConstructor @RequestMapping("/api/v1/members") public class MemberController { private final MemberService memberService; // create @PostMapping public ResponseEntity join(@Valid @RequestBody JoinRequestDto dto) { . . . return ResponseEntity.status(HttpStatus.CREATED).body( . . . ); // http api status 201 } // read @GetMapping("/{memberId}") pu..
제어자란?package (패키지)related group of things when they are offered together as a single unit단일 단위로 함께 제공될 때 관련된 사물 그룹modifier (수식어, 제어자)a word or phrase that is used with another word or phrase to limit or add to its meaning그 의미를 제한하거나 더하기 위해 다른 단어나 구와 함께 사용되는 단어나 구 패키지package com.practice;소스의 가장 첫 줄에 있어야만 한다.파일 하나에 반드시 하나만 존재해야 한다.파일이 위치한 폴더명과 같아야 한다.예약어를 사용할 수 없다. importimport java.util.*; // * 은..
DTO(Data Transfer Object) vs VO(Value Object) vs Entity DTO 데이터를 다른 서버로 전달하는 것이 목적 controller - sevice - repository 계층 간의 데이터 이동을 위해 사용 VO 데이터를 담아두기 위한 목적 setter를 사용하지 않음으로써 불변으로 담아둘 수도 있다. Entity DB 테이블 데이터와 매핑하는 객체 데이터 객체라고도 부른다. dto는 vo보다 넓은 의미라고 봐도 무방하다. 반드시 하나만 써야하는 것은 아니며 entity 까지 3가지를 전부 사용하기도 한다. 목적에 따른 의미가 다를 뿐, 결국 사람이 구분하기 위해 이렇게 사용하는 것이므로 반드시 이렇게 써야한다는 정답은 없다.
상속이란?inheritance (상속)a physical or mental characteristic inherited from your parents, or the process by which this happens 부모로부터 물려받은 신체적 또는 정신적 특성, 또는 이것이 일어나는 과정overriding (오버라이딩)to take control over something, especially in order to change the way it operates 특히 운영 방식을 바꾸기 위해 무언가를 통제하는 것 a device that changes the control of a machine or system in special situations, especially from automatic ..