Java
-
Singleton ContainerJava/Spring 2024. 12. 18. 17:13
스프링의 싱글톤 컨테이너에 대해 정리하였습니다. 웹 애플리케이션과 싱글톤 >애플리케이션은 다양한 종류가 있습니다. 온라인 처리, 서버에서 백그라운드로 실행되는 데몬 프로세스, 특정 작업을 일괄적으로 처리하는 배치 애플리케이션 등 여러 형태가 존재합니다. 이 가운데, 스프링 프레임워크는 주로 기업용 온라인 서비스 개발을 지원하기 위해 만들어졌습니다. 물론, 스프링을 활용하면 웹뿐만 아니라 다른 종류의 애플리케이션도 개발할 수 있습니다.웹 애플리케이션의 경우 일반적으로 여러 사용자가 동시에 요청을 처리하는 상황이 발생하는데, 고객의 요청이 들어올 때마다 뭔가를 계속 만들어내는 경우가 문제가 될 수 있습니다. : 스프링이 없는 환경에서 순수 DI 컨테이너를 이용해 객체를 생성할 경우, 고객의 요청마다 새로운..
-
Spring Container & BeanJava/Spring 2024. 12. 12. 21:11
스프링의 핵심 개념인 컨테이너와 빈에 대해 정리하였습니다. 컨테이너(Container)와 빈(Bean) >컨테이너(Container) : 빈들의 생성, 관리, 의존성 설정 등을 담당하는 객체입니다.빈(Bean) : 애플리케이션에서 필요한 기능을 수행하는 구성 요소로, 컨테이너에 의해 관리되는 자바 객체입니다.컨테이너는 IoC(제어의 역전)에 따라 객체의 생성, 초기화, 소멸 등 생명주기를 관리하며, 의존성 주입(Dependency Injection)을 통해 필요한 의존 객체를 자동으로 연결합니다. 이에 따라 개발자는 필요한 빈을 선언하기만 하면 되고, 객체의 생성과 관리 등은 컨테이너가 담당하게 됩니다. Ex) 스프링 컨테이너 생성//스프링 컨테이너 생성ApplicationContext applicat..
-
Object-Oriented Design and SpringJava/Spring 2024. 11. 19. 03:16
스프링 프레임워크의 기본 개념과 객체 지향 설계를 연관지어 정리하였습니다. 스프링의 탄생 배경 >2000년대 초반, 자바 진영에서는 EJB(Enterprise Java Beans)가 표준 기술로 자리 잡고 있었으나, 복잡성과 느린 성능, 어려운 사용성 등으로 많은 개발자들에게 비판을 받게 되었습니다. 이러한 상황에서 POJO(Plain Old Java Object)라는 개념이 주목받으며, 원래의 간단한 자바 객체로 돌아가자는 움직임이 일어나게 됩니다. 로드 존슨이라는 개발자는 EJB의 이러한 문제점을 지적하며, EJB 없이도 높은 품질의 확장 가능한 애플리케이션을 개발할 수 있음을 보여주고자 2002년에 책을 출간했습니다. 이 책에는 30,000라인 이상의 예제 코드가 포함되어 있었으며, 이들 코드에는..
-
Custom Queries with JPAJava/Spring 2024. 10. 15. 16:37
JPA를 이용한 커스텀 쿼리 작성법에 대해 정리하였습니다. Based on how the method is named, Spring Data JPA will automatically generate the “implementation” of the method when your application is compiled. The naming of the method declarations is extremely important here. The rules for the method names are detailed in the Spring documentation JPA Query Methods :: Spring Data JPAAs of Spring Data JPA release 1.4, we su..
-
Add a Database with JPAJava/Spring 2024. 10. 14. 00:42
Spring Data JPA(Java Persistence API)에 대해 정리하였습니다. Spring Data JPA is a library for Spring that helps to integrate a database into your REST API.Spring Data JPA is an abstraction layer that allows us to interact with objects in your code rather than write SQL queries. org.springframework.boot spring-boot-starter-data-jpa: To be able to use JPA in your project, you’ll have to add that depend..
-
Spring ControllersJava/Spring 2022. 2. 11. 16:26
Spring의 Controller에 대해 정리하였습니다. The Spring framework is an incredible resource to help us quickly build RESTful applications. The core functionality of these applications lies in their ability to receive requests, route them accordingly, and provide a proper response. Annotations : recognized by their starting @ symbol, are built-in units of Spring code that make complex functionality readily a..
-
Hello SpringJava/Spring 2022. 2. 10. 15:39
자바의 스프링 프레임워크와 HTTP요청을 이용하는 방법을 정리하였습니다. What is Spring? >Spring is an open-source Java framework that is useful, among other things, for building RESTful web applications. Like any web framework, Spring comes with an established set of code conventions and patterns, such as predefined templates, databases, and functions.Spring contains templates for many different kinds of applications, or “Sp..
-
DebuggingJava 2022. 2. 10. 02:05
자바에서 버그의 종류와 디버깅 방법에 대해 정리하였습니다. What makes a programmer successful isn’t avoiding errors; it’s knowing how to find the solution. In Java, there are many different ways of classifying errors, but they can be boiled down to three categories:Syntax errors: Errors found by the compiler.Run-time errors: Errors that occur when the program is running.Logic errors: Errors found by the programmer looki..