ModelMapper enables to convert DTO to an entity.DTO를 이용 id 값을 드러내지 않게한다.사용된 DTO를 entity(User class) 로 다시 변경하기위해 ModelMapper를 사용 You need to add ModelMapper bean at @SpringBootApplication. It let us use ModelMapper in different classes. ModelMapper @Bean을 @SpringBootApplication에 등록한다. @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication...
Users - This class takes the role of Model which dealing with Data UsersAPIController - Handle request of users and response UsersService - When the application starts, an instance which has @Service annotation is created. - By default, It is a Singleton pattern - Other Class, Service, Controller can be injected by using Dependency Injection. UsersRepository (DAO - Data Acess Object) - Control D..
Creating Spring Boot application with IntelliJ 1. File - New - Project 2. Choose Spring Initializr 3. Choose Type as Gradle Project Maven/Gradle - it is a build automation system, dependency management tool. no need to download dependencies and add it to the classpath.- It creates a starter project. you don't need to create all the individual files yourself. semantic versioning- 0(major version)..
@Controller and @RestController 123@Controller@ResponseBodypublic class MyController{}cs@Controller 일때는 @ResponseBody 까지 명시해줘야 하지만 12@RestControllerpublic class MyRestController{}cs@RestController 는 @ ResponseBody가 이미 자동적으로 적용이 되기 때문에 따로 적어주지 않아도 사용할 수 있다. @ResponseBody- Java객체를 http응답객체로 전송할 수 있다. - Serialization(converting Object to JSON) @RequestBody- 요청이 온 data(JSON or XML) 를 바로 class 나 mode..
DI Dependency Injection 의존성 주입 - IoC (Inversion of Control) and DI are used to be interchangeable. - A programmer is central to the program, but the control of the entire program is the framework. - Inject bean by assembler not Object itself - Spring Container create Bean and control the life cycle of it. Example Code I public class Person{ private Writer text; public Person() { text = new Anoth..
@SpringBootConfiguration - @Configuration과 같음. Bean을 등록하는 Java 설정파일(@Component, @Service, @Repository, @Controller, @Configuration annotation 이 붙은 method 를 @Autowired로 bean을 생성할 수 있다.)이며 @Configuration 자신도 bean으로 등록된다. @ComponentScan - The first stage to read Bean. - @Component,@Configuration,@Repository,@Service,@Controller,@RestController 를 가진 Class 들을 scan해서 bean으로 등록한다. - 다 같은 이름으로 하지 않고 저렇게..
- Total
- Today
- Yesterday
- 프로그래머스
- 알고리즘
- 프로그래머스 알고리즘문제
- hackerrank solution
- Javascript Algorithm
- repeat()
- substring()
- 프로그래머스 알고리즘
- ... in Javascript
- algorithm
- hackerrank
- code refactoring
- HashMap
- math.abs
- javascript
- java
- easy algorithm
- hackerrank javascript solution
- rest parameter
- math.max
- easy javascript algorithm
- hackerrank javascript
- C++
- compareTo()
- spring boot application
- Collection Framework
- string class in java
- HackerRank Algorithm
- Object type casting
- equals()
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |