Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸš€ 3단계 - μš”κΈˆ μ •μ±… μΆ”κ°€ #488

Open
wants to merge 15 commits into
base: moonstal1506
Choose a base branch
from

Conversation

moonstal1506
Copy link

μ•ˆλ…•ν•˜μ„Έμš” μ€€μ˜€λ‹˜!
μ €λ²ˆ ν”Όλ“œλ°± μžμ„Έν•˜κ²Œ μ„€λͺ…ν•΄μ£Όμ…”μ„œ κ°μ‚¬ν–ˆμŠ΅λ‹ˆλ‹€πŸ™
ν”Όλ“œλ°± μ μš©ν•΄μ„œ μ½”λ“œ μˆ˜μ •ν–ˆμŠ΅λ‹ˆλ‹€!
λ„˜ λŠ¦μ—ˆμ§€λ§Œ.. λκΉŒμ§€ μ•ˆν•˜λ©΄ ν›„νšŒν•  것 κ°™μ•„μ„œ PR μ˜¬λ €λ΄…λ‹ˆλ‹€..γ…Žγ…Ž
ν˜Ήμ‹œλΌλ„ μ‹œκ°„μ΄ λ˜μ‹ λ‹€λ©΄ 리뷰 λΆ€νƒλ“œλ¦½λ‹ˆλ‹€πŸ™‡β€β™‚οΈ
κ°μ‚¬ν•©λ‹ˆλ‹€!!

Copy link

@bactoria bactoria left a comment

Choose a reason for hiding this comment

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

μˆ˜μ •λ‹˜ λ§ˆμ§€λ§‰κΉŒμ§€ λ§ˆμ…˜ 잘 ν•΄μ£Όμ…¨λŠ”λ°!! 리뷰가 λŠ¦μ—ˆλ„€μš” 😭

λ¨Όμ €, λ―Έμ…˜ 사이클에 λ„ˆλ¬΄ 잘 κ΅¬ν˜„ν•΄ μ£Όμ…”μ„œ λ¦¬λ·°ν•˜κΈ°κ°€ νŽΈν–ˆμ–΄μš”. πŸ’―
λͺ‡κ°€μ§€ μ½”λ©˜νŠΈ λ‚¨κ²¨λ‘μ—ˆλŠ”λ° 확인 λΆ€νƒλ“œλ €μš”.
λ°˜μ˜μ€ ν•„μˆ˜λ‘œ ν•˜μ§€ μ•ŠμœΌμ…”λ„ λ˜λŠ”λ°, μ—¬μœ κ°€ λ˜μ‹ λ‹€λ©΄ λ°˜μ˜ν•΄λ³΄μ…”λ„ μ’‹μ•„μš”!!πŸ™Œ
λ¦¬λ·°μš”μ²­ μ£Όμ‹œλ©΄ λ¨Έμ§€ν•˜λ„λ‘ ν• κ²Œμš”! 고생 λ§ŽμœΌμ…¨μŠ΅λ‹ˆλ‹€ πŸ™‡β€β™‚οΈ

Comment on lines 38 to 41
public Line(String name, String color, int extraFare, Section section) {
this(name, color, section);
this.extraFare = extraFare;
}
Copy link

Choose a reason for hiding this comment

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

Line40의 extraFare λŠ” μ£Όμƒμ„±μžμ—μ„œ μ΄ˆκΈ°ν™”λ₯Ό ν•΄μ£Όμ–΄μ•Ό ν•  것 같은데, λ³΄μ‘°μƒμ„±μžμ—μ„œ μ΄ˆκΈ°ν™”λ₯Ό ν•΄μ£Όκ³  μžˆλ„€μš”.
[μ—˜λ ˆκ°•νŠΈ 였브젝트] 1-2μž₯ μƒμ„±μž ν•˜λ‚˜λ₯Ό μ£Ό μƒμ„±μžλ‘œ λ§Œλ“œμ„Έμš” 글을 μ°Έκ³ ν•˜μ‹œλ©΄ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€!

(+ ν˜„μž¬ μ£Όμƒμ„±μžλŠ” ν…ŒμŠ€νŠΈ μ½”λ“œμ—μ„œλ§Œ μ‚¬μš©λ˜κ³  μžˆλŠ”λ° μ œκ±°ν•˜κ³ , λ³΄μ‘°μƒμ„±μžλ₯Ό μ£Όμƒμ„±μžλ‘œ λ§Œλ“€λ©΄ μ–΄λ–¨λΌμš”?)

@@ -9,11 +10,13 @@ public class Path {
private List<Station> stations;
private int distance;
private int duration;
private List<Line> usedLine;

Choose a reason for hiding this comment

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

Aμ—­μ—μ„œ Cμ—­κΉŒμ§€μ˜ 경둜라고 ν•˜λ©΄ Aμ—­ ---------> Bμ—­ ---------> Cμ—­ 으둜 λ³Ό μˆ˜λ„ μžˆμ§€λ§Œ,
Aμ—­ -----μ‹ λΆ„λ‹Ήμ„ -----> Bμ—­ -----2ν˜Έμ„ ------> Cμ—­ 으둜 생각할 μˆ˜λ„ μžˆμ„ 것 κ°™μ•„μš”.

이번 λ‹¨κ³„μ˜ λ…Έμ„  μΆ”κ°€μš”κΈˆ μ •μ±…μœΌλ‘œ 인해 usedLine κ°€ μΆ”κ°€λ˜μ—ˆλ„€μš” πŸ‘
λ‹€λ₯Έ λ°©λ²•μœΌλ‘œλŠ” stations λŒ€μ‹ μ— sections(ꡬ간)λ₯Ό λ„£μ–΄μ€€λ‹€λ©΄ usedLine을 λ³„λ„λ‘œ λ§Œλ“€μ§€ μ•Šμ•„λ„ 될 것 κ°™μ•„μš”!
이 방법은 μ–΄λ– μ‹ κ°€μš”?

경둜(Path)λŠ” κ²°κ΅­ ꡬ간듀(Sections)의 μΌκΈ‰μ»¬λ ‰μ…˜μœΌλ‘œ λ³Ό 수 μžˆμ„ 것 κ°™μ•„μš”!
(μ΄λ ‡κ²Œ λ§Œλ“ λ‹€λ©΄ distance와 duration ν•„λ“œλ„ μ œκ±°κ°€ κ°€λŠ₯ν•©λ‹ˆλ‹€ πŸ˜†)

@@ -1,19 +1,42 @@
package nextstep.path.fare;

import java.util.Objects;

public class Fare {

Choose a reason for hiding this comment

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

값객체 πŸ’―


@DisplayName("λ‚˜μ΄μ— 따라 μš”κΈˆμ„ ν• μΈν•œλ‹€")
@ParameterizedTest
@CsvSource({"6, 450", "13, 720", "19, 1250"})

Choose a reason for hiding this comment

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

경계ꡬ간 ν…ŒμŠ€νŠΈ πŸ’―


@DisplayName("μš”κΈˆ λ”ν•˜κΈ°")
@Test
void plus() {

Choose a reason for hiding this comment

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

도메인 λͺ¨λΈμ— λŒ€ν•œ ν…ŒμŠ€νŠΈλ„ 잘 ν•΄μ£Όμ…¨λ„€μš” πŸ˜„

@moonstal1506
Copy link
Author

moonstal1506 commented Apr 17, 2024

λ§ˆμ§€λ§‰κΉŒμ§€ λ¦¬λ·°ν•΄μ£Όμ…”μ„œ κ°μ‚¬ν•©λ‹ˆλ‹€πŸ™
μ€€μ˜€λ‹˜ 덕뢄에 λ―Έμ…˜λ„ λκΉŒμ§€ ν•  수 μžˆμ—ˆκ³  배운점이 λ§Žμ•˜μŠ΅λ‹ˆλ‹€!!
λ‹€μ‹œ ν•œλ²ˆ κ°μ‚¬λ“œλ¦½λ‹ˆλ‹€:)

Comment on lines 11 to 17
private List<Station> stations;
private int distance;
private int duration;
private List<PathSection> pathSections;

public Path(List<Station> stations, int distance, int duration) {
public Path(List<Station> stations, List<PathSection> pathSections) {
this.stations = stations;
this.distance = distance;
this.duration = duration;
this.pathSections = pathSections;
}
Copy link
Author

@moonstal1506 moonstal1506 Apr 17, 2024

Choose a reason for hiding this comment

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

stations λŒ€μ‹  sections(ꡬ간) 좔가에 λŒ€ν•œ ν”Όλ“œλ°±μ„ λ°›κ³ 

  1. μƒμ„±μžλ‘œ pathSections만 λ°›μ•„μ„œ 응닡값(PathResponse)에 ν•„μš”ν•œgetStations()λ₯Ό κ΅¬ν˜„ν•˜λŠ” 방법과
  2. SubwayMap의 findPathμ—μ„œ path.getVertexList()λ₯Ό ν•˜λ©΄ stationsλ₯Ό λ°”λ‘œ 얻을 수 μžˆλ‹€λŠ” μ μ—μ„œ stations와 pathSectionsλ₯Ό λ°›λŠ” 방법이 κ³ λ―Όλ˜μ—ˆμŠ΅λ‹ˆλ‹€!
public Path findPath(Station source, Station target, PathType pathType) {
    GraphPath<Station, PathSection> path = getGraphPath(source, target, pathType);
    return new Path(path.getVertexList(), path.getEdgeList());
}

1λ²ˆμ€ stations κ΅¬ν•˜λŠ” λ‘œμ§μ„ ν•œλ²ˆ 더 μž‘μ„±ν•΄μ•Ό ν•œλ‹€λŠ” 점,
2λ²ˆμ€ pathSectionλ‘œλ„ κ΅¬ν˜„ κ°€λŠ₯ν•œλ° stationsλ₯Ό 또 λ°›λŠ”λ‹€λŠ” μ μ—μ„œ
μ–΄λ–€ 방식을 κ³ λ₯΄λ©΄ μ’‹μ„κΉŒμš”πŸ€”

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