Skip to content

[이진용] 스프린트3#53

Open
alpha-lens wants to merge 36 commits intocodeit-bootcamp-spring:이진용from
alpha-lens:이진용-sprint3

Hidden character warning

The head ref may contain hidden characters: "\uc774\uc9c4\uc6a9-sprint3"
Open

[이진용] 스프린트3#53
alpha-lens wants to merge 36 commits intocodeit-bootcamp-spring:이진용from
alpha-lens:이진용-sprint3

Conversation

@alpha-lens
Copy link
Collaborator

요구사항

기본

  • Spring 프로젝트 초기화
  • Bean 선언 및 테스트
  • Spring 책심 개념 이해하기 (하단에 추가함)
  • Lombok 적용
  • 비즈니스 로직 고도화

심화

  • Bean 다루기

Spring 핵심 개념 이해하기

[x] JavaApplication과 DiscodeitApplication에서 Service를 초기화하는 방식의 차이에 대해 다음의 키워드를 중심으로 정리해보세요.

  • IoC Container, Dependency Injection, Bean

JavaApplication에서는
생성자와 매개변수를 통해 의존성을 직접 주입하며 객체를 초기화했다.
어떤 객체를 생성할지, 언제 의존성을 주입할지, 어떤 구현체를 사용할지는 모두 개발자가 직접 결정해야 했다.

DiscodeitApplication에서는
Spring의 IoC Container가 객체 생성과 생명주기를 관리한다.
@Service, @Repository와 같은 어노테이션을 통해 객체가 Bean으로 등록되며,
생성자 기반 Dependency Injection을 통해 필요한 의존성이 자동으로 주입된다. (= @RequireArgsConstructor)
또한 초기화 시 필요한 로직은 @PostConstruct를 통해 처리할 수 있다.

이처럼 객체 생성, 생명주기 관리, 의존성 주입의 책임이 개발자에서 Spring IoC Container로 이동함으로써
코드의 양이 줄어들고 결합도가 낮아졌으며, 그 결과 코드 분석과 리팩토링에 소요되는 시간이 줄어들었다.

멘토에게

  • 셀프 코드 리뷰를 통해 질문 이어가겠습니다.

Date : 20260109

Today I work's...
Server && Channel make test logic
로그인 로그아웃 기능 추가.
기타 버그 수정
채널 서비스 관련한 업데이트
ResponseDto를 이용하여 채널 서비스를 고도화하였으며
향후 사용자의 마지막 읽은 메시지 내용 등을 추가하는 작업이 필요함.
첨부파일 기능을 추가했다. (아직 테스트중)
MVC에 맞게 조금 리팩토링했다. (Service에서 출력하는 기능 제거 등)
메시지 조회 불가능한 버그를 고쳤다. (아직 테스트 중)
1. 유저/채널 삭제시 메시지랑 BinaryContent도 삭제되게 체이닝
2. Exeption 종류 추가함
3. 전반적인 리팩토링을 진행함
4. Relation을 BinaryContent에서 User, Message로 분산함.
1. JCF System을 추가했다.
2. yml Profile을 통해 교체할 수 있도록 설정했다.
3. FIX: 유저 삭제시 해당 채널의 메시지를 삭제하다 발생하는 오류를 수정했다.
4. Refector: 사용하지 않는 Import를 삭제했다.
Application.yml을 통해 file, jcf를 선택할 수 있게 했다.
@alpha-lens alpha-lens added the 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. label Feb 8, 2026
import java.util.UUID;

@Getter
public class BinaryContent implements Serializable {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 클래스 외에도 엔티티 계층 요소들은 ~ Entity로 명시해주는 편이 좋습니다~!

import java.util.concurrent.ConcurrentHashMap;

@Repository
@Profile("file")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ConditionalOnProperty로 써주셔야 합니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments