게임모드공유웹 <ModHub> 제작기 - 모듈 공부

김상우·2024년 11월 12일

ModHub(Project)

목록 보기
2/13

프로젝트에서 쓸 Spring Boot를 세팅할 때 기본적으로 설정한 모듈에 대해 공부해보자.

Spring Web

implementation 'org.springframework.boot:spring-boot-starter-web'
  • 웹 어플리케이션, RESTful 서비스 개발에 사용
  • Spring MVC 아키텍처 기반으로 웹 요청 처리, 응답 생성에 기능 제공
  • Spring Web를 사용하면 HTTP 방식으로 입력을 받을 수 있게
    • ex) Scanner로 키보드로 입력 → URL경로, json 등 입력

REST에 대해서도 작성 必

Thymeleaf

implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
  • 서버사이드(서버에서 처리가 이루어짐) 템플릿 엔진의 한 종류
  • 백엔드 서버에서 HTML을 동적으로 렌더링하는데 사용
  • "With modules for Spring Framework, a host of integrations with your favourite tools, and the ability to plug in your own functionality, Thymeleaf is ideal for modern-day HTML5 JVM web development"
    • → Spring Framework용 모듈과 즐겨쓰는 도구와 다양한 통합 기능, 그리고 사용자가 직접 만든 기능을 플러그인으로 추가할 수 있는 기능
  • 타임리프로 작성된 자연스러운 HTML 템플릿
  • 유연한 통합 환경 → 스프링의 다양한 기능 편리하게 사용 가능
  • 프론트단의 풍부한 컨텐츠, 텍스트 표현의 이점
  • 참조

Spring Data JPA(Java Persistence API)

implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
  • 데이터 액세스 계층의 구현을 크게 개선하기 위해 사용
  • Repository 인터페이스 제공
    • 데이터 접근을 위한 기본적인 CRUD 메서드를 자동으로 제공
    • JpaRepository<Entity, ID> 인터페이스를 상속하는 것만으로도 기본 구현 제공
  • "As a developer you write your repository interfaces using any number of techniques, and Spring will wire it up for you automatically. You can even use custom finders or query by example and Spring will write the query for you!"
    • → 개발자의 리포지토리 인터페이스를 스프링이 자동 연결
    • → 사용자 정의 파인더, 쿼리 사용 가능
  • 보일러플레이트 코드 감소의 이점
    • ex) 트랜잭션, crud 메서드
  • 참조

Lombok

	compileOnly 'org.projectlombok:lombok'
	annotationProcessor 'org.projectlombok:lombok'
  • 자바 라이브러리
  • @Getter/@Setter
  • @Data
  • 코드량 감소, 가독성 향상, 생산성 향상의 이점
profile
sudo love me spring

0개의 댓글