Giter Site home page Giter Site logo

jwp-dashboard-mvc's Introduction

MVC 프레임워크 구현하기

1단계 - MVC 프레임워크 구현하기

  • 학습테스트 통과시키기

    • Junit3TestRunner
    • Junit4TestRunner
    • ReflectionsTest
    • ReflectionTest
    • AnnotationHandlerMappingTest
  • JspView 구현

  • ManualHandlerMapping.java 와 AnnotationHandlerMapping.java 모두 사용할 수 있도록 변경

  • app/webapp/WEB-INF/web.xml 에 정적 리소스 매핑 추가

  • Legacy MVC와 Annotation Based MVC 통합 - RegisterController

구구 코드리뷰

  • HandlerAdapter 적용, move 메서드 삭제 및 JspView 활용

조앤 코드리뷰 - 1차

  • 회원가입 시 로그인 상태가 되는 기능 추가
  • setAccessible(true) -> trySetAccessible() 로 변경
  • HandlerAdapter 외부에서 주입하도록 수정
  • HandlerMappings, HandlerAdapters 일급 컬렉션화
  • RequestMapping 애노테이션 수정
  • Service 레이어 및 회원가입 검증로직 추가

2단계 - 리팩터링

  • ControllerScanner 추가
    • Relfections 라이브러리를 사용한다.
    • Relfections 객체로 @Controller가 설정된 모든 클래스를 찾는다.
    • 각 클래스의 인스턴스를 생성한다.

3단계 - View 구현하기

  • View 구현하기

    • JSON View 구현
  • Legacy MVC 제거하기

    • asis 패키지에 있는 레거시 코드를 삭제해도 서비스가 정상 동작하도록 구현

조앤 코드리뷰 - 1차

  • Controller Annotation이 달려있는 클래스 스캔 패키지 범위 더 좁게 수정
  • View name 분리해서 관리하도록 수정
  • API Controller 패키지 분리
  • 불필요한 객체 생성을 막도록 private 생성자 추가
  • 로그인한 사용자가 GET /register 요청 시, /index.jsp 로 리다이렉트 하도록 수정
  • app 모듈의 클래스 테스트 코드 추가
    • controller 패키지
      • api 패키지
        • HelloController.class
        • UserController.class
      • HomeController.class
      • LoginController.class
      • LogoutController.class
      • RegisterController.class
    • domain 패키지
      • User.class
    • repository 패키지
      • InMemoryUserRepository.class
    • service 패키지
      • LoginService.class
      • RegisterService.class
      • UserService.class
    • session 패키지
      • UserSession.class
  • mvc 모듈의 클래스 테스트 코드 추가
    • controller 패키지
      • AnnotationHandlerMapping.class
      • ControllerScanner.class
      • HandlerKey.class
    • handler 패키지
      • adapter 패키지
        • AnnotationHandlerAdapter.class
        • HandlerAdapters.class
      • mapping 패키지
        • HandlerMappings.class

jwp-dashboard-mvc's People

Contributors

kang-hyungu avatar taehee-kim-dev avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.