분류 전체보기
-
스프링 MVC -간단한 코드로 보는 원리Web/Spring 2023. 3. 4. 15:44
https://j-d-i.tistory.com/4 스프링MVC -관심사의 분리 스프링MVC패턴이란? 스프링 MVC패턴은 Model-View-Controller로 각각의 역할을 분담하여 요청을 처리하는 것을 의미한다. Model은 데이터, View는 화면, Controller는 model과 view사이 처리를 담당하여 클라이언 j-d-i.tistory.com 앞선 글에서 스프링MVC를 간단하게 살펴보았다. 위 글에서 다루지 않은 dispatcherServlet이 클라이언트 요청을 처음으로 받고 처리하는 과정 특히, 요청을 받고 매핑된 메서드에 매개변수에 맞게 적절하게 자료형을 변환하는 과정등을 살펴보자 스프링이 내부적으로 처리해주는 기능이긴 하지만, 알고나면 조금이나마 스프링을 이해하고 활용하는데 도움이 ..
-
스프링MVC -관심사의 분리Web/Spring 2023. 3. 4. 12:53
스프링MVC패턴이란? 스프링 MVC패턴은 Model-View-Controller로 각각의 역할을 분담하여 요청을 처리하는 것을 의미한다. Model은 데이터, View는 화면, Controller는 model과 view사이 처리를 담당하여 클라이언트 요청을 처리하게된다. 그렇다면 어떤 기준으로 MVC패턴을 만드는 것 일까? 먼저 간단한 코드를 통해 관심사에 따라 전체 코드를 분리해서 생각해보도록 하자. 여기서 관심사는 각 코드 혹은 메서드등이 처리해야할 일이다. 크게 입력, 처리, 출력 나누어 생각해 볼 수 있다. *관심사의 분리는 객체지향 설계 SOLID원칙의 S(SRP)에 따라 담당하는 기능을 기준으로 클래스(객체)를 분리하여 프로그램의 유지보수성을 높이기 위한 기법에서 나온 것이다. 단일책임원칙에 ..
-
재귀자료구조와 알고리즘/자료구조 2023. 3. 2. 10:05
1. 함수의 재귀적 호출 함수의 재귀적 호출이란, 함수 내에서 자기 자신을 다시 호출하는 것 간단하게 이해하는 방향은 하나의 함수는 원본이 있고, 재귀호출이 발생하면, 복사본이 만들어져서 호출한다고 생각해보자. 간단한 예제를 통한 재귀 호출의 흐름 Num 3으로 시작해서 조건 검사 -> true면 호출종료, false면 num=2로 recursive 재호출 -> 종료조건 만족 시, recursive (0) 반환 -> recursive(1)반환 -> recursive(3)반환 순서로 이어진다. *재귀함수는 탈출조건이 필요하다. * recursive호출을 기준으로 위 문장은 최종 반환 전 모든 함수가 반복하는 것, recursive 후는 탈출조건 만족 후 함수가 반환을 시작하면서 반복할 문장 예제2 팩토리얼..