Skip to content

이현석 sprint2-2 - #46

Open
giseo1107 wants to merge 6 commits into
codeit-bootcamp-spring:mainfrom
giseo1107:이현석-sprint2

Hidden character warning

The head ref may contain hidden characters: "\uc774\ud604\uc11d-sprint2"
Open

giseo1107 wants to merge 6 commits into
codeit-bootcamp-spring:mainfrom
giseo1107:이현석-sprint2

Conversation

@giseo1107

Copy link
Copy Markdown
Collaborator

요구사항

기본

  • 기본 항목 1
  • 기본 항목 2

심화

  • 심화 항목 1
  • 심화 항목 2

주요 변경사항

스크린샷

image

멘토에게

  • 구조는 어느정도 짜보았는데, 안에 구현은 거의 못했습니다.
  • 객체 직렬화 Serializable, transient는 객체에 넣어보는 정도는 하였으나, 실제 직렬화/역직렬화는 구현하지 못했습니다

@giseo1107
giseo1107 requested a review from Highjune August 10, 2026 15:05

}


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

전혀 중요하진 않지만, 여기 간격이 두 칸 이상 띄워져 있어서? 라인 일관성? 자체가 조금 다른 것 같아요!


@Serial
private static final long serialVersionUID = 1L;
private transient final UUID id;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

여기에서 transient 는 빼셔야 해요. 직렬화 할 떄 빠지거든요?
나중에 파일에서 다시 읽을떄(역 직렬화) 그 필드는 타입의 기본값으로 채워지게 되서, uuid 는 null 이 됩니다!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Message, User 도 마찬가지에요~!

import java.util.List;
import java.util.UUID;

public interface UserRepository {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

인터페이스 잘 선언하셧어요. 이제 이거를 구현하는 구현 객체가 있어야겠죠!? 그대로 구현해보세요! 그러면 자동으로 구현해야할 메서드가 뜰거에요! 컴파일 에러로 잡힐겁니다.

import java.util.List;
import java.util.UUID;

public interface ChannelRepository {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

이것도 마찬가지로 구현체가 없습니다!

import java.util.List;
import java.util.UUID;

public interface MessageRepository {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

구현체가 없네요~!

import java.util.List;
import java.util.UUID;

public class FileUserService implements UserService {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

이거는 서비스인데 제일 위의 패키지가 repository 이네요.

그런데 FileChannelService.java, FileMessageService.java -> 이거는 service/file/에 동일본 있어서
repository/file/의 서비스 3개 삭제가 필요합니다~!

import com.sprint.mission.discodeit.entity.User;
import com.sprint.mission.discodeit.repository.UserRepository;
import com.sprint.mission.discodeit.service.UserService;
import java.io.FileReader;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

사용하지 않는 import 는 지워주세요~!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

intelliJ 에서 특정 클래스에서 사용하지 않는 import 정리하는 단축키가 있습니다~!

@Highjune

Copy link
Copy Markdown
Collaborator

현석님, sprint2-2 뼈대 잘 잡으셨어요! 서비스 인터페이스 나누고, Repository 인터페이스 선언하고, 서비스가 Repository를 생성자로
주입받게 한 것 — 이번 미션이 원하는 구조 방향을 정확히 잡으셨습니다. 아직 구현이 덜 됐다고 하셨는데, 방향이 맞으니 여기서부터는 하나씩
채우기만 하면 돼요. 순서를 잡아드릴게요. 한 단계씩, 매번 실행해서 확인하면서 가시면 됩니다.

1단계 — id의 transient 먼저 제거 -> 리뷰 남겻습니다!
2단계 Repository 구현체 만들기 (이번 미션의 핵심) -> 요거 그대로 구현하시면 됩니다. 뒤에 -Impl 이런식으로 붙여서 클래스 만들어서요!

일단 요렇게만 먼저 해보세요! 사실 나머지는 파일 정리 (service 에 정의되어 잇는데 rpeository 에 또 선언햇다던지) 이런 것들이라
사실 1, 2단계만 하면 끝나요!

수고하셨습니다 현석님!!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants