Skip to content

[운송II - 주문]미션 구현 (정규호)#9

Open
kokkumong wants to merge 8 commits intoallrounder-backend:mainfrom
kokkumong:6주차

Hidden character warning

The head ref may contain hidden characters: "6\uc8fc\ucc28"
Open

[운송II - 주문]미션 구현 (정규호)#9
kokkumong wants to merge 8 commits intoallrounder-backend:mainfrom
kokkumong:6주차

Conversation

@kokkumong
Copy link

No description provided.

@kokkumong kokkumong changed the title [6주차 구현] 정규호 [운송II - 주문]미션 구현 (정규호) Aug 18, 2025
this.output = output;
}

public void run(){

Choose a reason for hiding this comment

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

메소드 분리를 잘 해서 깔끔한 코드가 된 것 같습니다.

throw new IllegalArgumentException("입력 형식이 올바르지 않습니다. (예: 출발지-도착지(이름))");
}
String[] parts = new String[3];
String regex = "(.+)-(.+)\\((.+)\\)";

Choose a reason for hiding this comment

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

정규식을 썼군요. 깔끔하고 좋아요.

Copy link

@daeGULLL daeGULLL left a comment

Choose a reason for hiding this comment

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

헥사고날 아키텍쳐를 잘 사용하신 것 같아요! 사소한 제안점들만 검토해주시면 더 훌륭한 코드가 될 것 같습니다. 수고하셨어요~

}
catch(FileNotFoundException e){
System.err.println("position.csv : 파일을 찾을 수 없습니다.");
}

Choose a reason for hiding this comment

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

suggestion : 이런 예외들이 반복되는 상황이라, 따로 exception 디렉토리를 만들어서 예외들을 관리하는 방안이 나을 것 같아요. 커스텀 예외 클래스에서 받는 파라미터에 위치 String을 입력하게 하면 깔끔하게 관리할 수 있을거에요. Static factory 패턴을 이용한 예외 클래스 제작이 회의방의 메세지에 있으니 참고하세요.


@Override
public void startDelivery(int id, Duration deliveryDuration){
int totalMinutes = (int) deliveryDuration.toMinutes();

Choose a reason for hiding this comment

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

nitpick : 이렇게 계산이 필요한 데이터를 받는 것은 의존성이 강해진다고 판단해서, 외부에서 계산을 거친 duration 내부의 값들만 parameter로 받게끔 하는게 나을 것 같아요. ex) startDelivery(int id, int hour, int minute). 아니면 계산을 거친 값들만 dto에 저장하게 해도 좋을 것 같네요.

public int getPlaceId() {
return placeId;
}

Choose a reason for hiding this comment

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

nitpick : 이렇게 단순히 get, set만 하는 모델의 경우에는 record로 만드는 것이 더 간편해요.

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.

3 participants