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

๐Ÿ”ง ๋ชฉํ‘œ ๊ธˆ์•ก ์œ ์ฆˆ ์ผ€์ด์Šค ๋ฆฌํŒฉํ† ๋ง #112

Merged
merged 21 commits into from
Jun 25, 2024

Conversation

psychology50
Copy link
Member

@psychology50 psychology50 commented Jun 12, 2024

์ž‘์—… ์ด์œ 

๐Ÿ’ก PR ์ œ๋ชฉ์— "Api: "๋ฅผ ๋ถ™์ด์ง€ ์•Š์€ ์ด์œ ๋Š” ์ค‘์  ํ™•์ธ ์‚ฌํ•ญ์— ์ ์–ด๋‘๊ฒ ์Šต๋‹ˆ๋‹ค.

  • as-is. ํ…Œ์ŠคํŠธ ์‹คํ–‰ ์‹œ๊ฐ„์ด ๋„ˆ๋ฌด ์˜ค๋ž˜๊ฑธ๋ฆผ. ๊ธธ๋ฉด 3๋ถ„์ด ๋„˜๋Š” ๊ฒฝ์šฐ๋„ ์กด์žฌํ•จ.
  • why? ํ†ตํ•ฉ ํ…Œ์ŠคํŠธ๋ฅผ ๋ถˆํ•„์š”ํ•˜๊ฒŒ ๋งŽ์ด ์ž‘์„ฑํ•จ.
  • why? ์„œ๋น„์Šค ๊ณ„์ธต ๋‹จ์œ„ ํ…Œ์ŠคํŠธ๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๊ฒŒ ๋„ˆ๋ฌด ํž˜๋“ฆ.
  • why? ์˜์กด์„ฑ ์ฃผ์ž…์ด ๋„ˆ๋ฌด ๋ณต์žกํ•˜๊ณ , ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค ์Šคํฌ๋ฆฝํŠธ ๋ผ์ธ ์ˆ˜๊ฐ€ ๋„ˆ๋ฌด ๊ธธ์–ด์ง
  • why? ์•„ํ‚คํ…์ฒ˜๊ฐ€ ์ž˜๋ชป๋˜์—ˆ๊ธฐ ๋•Œ๋ฌธ์ด๋ผ๊ณ  ํŒ๋‹จ
  • how? ํŒŒ์‚ฌ๋“œ ํŒจํ„ด์„ ๋ณด๋‹ค ์ฒ ์ €ํ•˜๊ฒŒ ์ค€์ˆ˜ํ•˜์—ฌ, ์„œ๋กœ ๋‹ค๋ฅธ UseCase์— ๋ณ€ํ™”์— ์˜ํ•œ ์˜ํ–ฅ์„ ์ค„์ด๋„๋ก ํ•œ๋‹ค.

์ž‘์—… ์‚ฌํ•ญ

1๏ธโƒฃ ๋ฌธ์ œ์˜ ์›์ธ

image
(๋ฐ‘์— ์‹œํผ๋Ÿฐ ์ ์„ ์œผ๋กœ ๋‘˜๋Ÿฌ์Œ“์ธ ๊ฒƒ๋“ค์€ ํ…Œ์ŠคํŠธ ํ•ด์•ผ ํ•  ๋Œ€์ƒ์„ ์˜๋ฏธ. ๊ฐ๊ฐ ํ•˜๋‚˜์˜ ํด๋ž˜์Šค ํ˜น์€ ํŒŒ์ผ์ด๋ผ ์ƒ๊ฐํ•ด๋„ ๋ฌด๋ฐฉ)

  • ๋””์Šค์ฝ”๋“œ์™€ ๋ธ”๋กœ๊ทธ์—์„œ ๋ง์”€๋“œ๋ฆฐ ๊ฒƒ์ฒ˜๋Ÿผ ๋น„๋‹ˆ์ง€์Šค ๋กœ์ง์„ UseCase + Service ํด๋ž˜์Šค๊ฐ€ ํ•จ๊ป˜ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.
  • ๊ฒฐ๊ตญ ๋‹จ์œ„ ํ…Œ์ŠคํŠธ ํƒ€๊ฒŸ์ด UseCase๊ฐ€ ๋˜๋Š”๋ฐ, ์˜์กด์„ฑ์œผ๋กœ ์ธํ•œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.
    • ex. ๋ชฉํ‘œ ๊ธˆ์•ก ์‚ญ์ œ ํ…Œ์ŠคํŠธ์—๋Š” ์‚ฌ์šฉ์ž ์„œ๋น„์Šค ๋นˆ์ด ํ•„์š”์—†์Œ์—๋„, ํ•จ๊ป˜ ์ฃผ์ž… ๋ฐ›์•„์•ผ ํ•จ.
    • ๋งŒ์•ฝ ๋‹ค๋ฅธ ๋นˆ์ด ์ฃผ์ž…๋˜๋ฉด, ๊ธฐ์กด์˜ ๋ชจ๋“  ํ…Œ์ŠคํŠธ ๋นˆ ์ฃผ์ž… ์—๋Ÿฌ๋กœ ์ธํ•ด ์‹คํŒจํ•จ.

2๏ธโƒฃ ๊ฐœ์„  ๋ฐฉ๋ฒ•

image

  • UseCase๋Š” ๋” ์ด์ƒ ๋น„์ง€๋‹ˆ์Šค ๋กœ์ง์— ๊ด€์—ฌํ•˜์ง€ ์•Š์œผ๋ฉฐ, ํŒŒ์‚ฌ๋“œ ํŒจํ„ด์˜ ๋ผ์šฐํ„ฐ ์—ญํ• ๋งŒ์„ ์ถฉ์‹คํžˆ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.
  • ์ด์ œ ๋‹จ์œ„ ํ…Œ์ŠคํŠธ ํƒ€์ผ“์ด UseCase๊ฐ€ ์•„๋‹Œ Service๊ฐ€ ๋˜๋ฏ€๋กœ, ๋‹ค๋ฅธ ๋นˆ์ด UseCase์— ์ถ”๊ฐ€๋œ๋‹ค๊ณ  ํ•ด๋„ ๋‹ค๋ฅธ ํ…Œ์ŠคํŠธ์— ์˜ํ–ฅ์„ ์ฃผ์ง€ ๋ชป ํ•ฉ๋‹ˆ๋‹ค.
  • ํ…Œ์ŠคํŠธ ํŒŒ์ผ์„ ๋ถ„๋ฆฌํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜์—ˆ์œผ๋ฏ€๋กœ, ๊ฐœ๋ฐœ์ž์™€ ๋ฆฌ๋ทฐ์–ด ๋ชจ๋‘ ๋ณด๋‹ค ํ…Œ์ŠคํŠธ์˜ ๊ด€์‹ฌ์‚ฌ์— ์ง‘์ค‘ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (์ถฉ๋Œ๋„ ์–ด์ง€๊ฐ„ํ•ด์„  ์•ˆ ๋‚  ๊ฑฐ๋ผ ์˜ˆ์ƒํ•˜๋Š”๋ฐ, ์ค‘์  ํ™•์ธ ํŒŒํŠธ์—์„œ ์–ธ๊ธ‰ํ•  ๋‚ด์šฉ์ด ์žˆ์Œ.)

๋ฆฌ๋ทฐ์–ด๊ฐ€ ์ค‘์ ์ ์œผ๋กœ ํ™•์ธํ•ด์•ผ ํ•˜๋Š” ๋ถ€๋ถ„

  1. PR ์ ‘๋‘์‚ฌ์— Api:๋ฅผ ๋ถ™์ด์ง€ ์•Š์€ ์ด์œ 
    • ๋‚˜๋จธ์ง€ UseCase๋„ ๋ฆฌํŒฉํ† ๋ง ์ž‘์—…์„ ํ•˜๋ฉด, ํ•  ๋•Œ๋งˆ๋‹ค ํƒœ๊ทธ ๋ฒ„์ „์—…์ด ๋  ํ…๋ฐ ๊ฐ•์ œ๋กœ ์‹คํŒจํ•˜๊ฒŒ ๋งŒ๋“  ๋‹ค์Œ ํ•œ ๋ฒˆ์— ํƒœ๊น…ํ•˜๋ ค๋Š” ๋ชฉ์ ์ด์—ˆ์Šต๋‹ˆ๋‹ค. ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”??
  2. ์™œ Service ํด๋ž˜์Šค๋ฅผ ๋‚˜๋ˆ„๋‹ค๊ฐ€ ๋ง์•˜๋Š”์ง€์— ๋Œ€ํ•ด์„œ. (ex. TargetAmountSaveService๊ฐ€ create์™€ update ๋ฉ”์„œ๋“œ๋ฅผ ๊ฐ€์ง)
    • (์ €์žฅ & ์‚ญ์ œ), (์ˆ˜์ • & ๊ฒ€์ƒ‰)๊ณผ ๊ฐ™์€ ์œ ์ฆˆ ์ผ€์ด์Šค ์กฐํ•ฉ์€ ์ค‘๋ณต ๋กœ์ง์ด ๊ฑฐ์˜ ์—†๋‹ค๋Š” ๊ฒƒ์„ ๊ฐ€์ •ํ•ด๋ณด์•˜์Šต๋‹ˆ๋‹ค. (ํ˜„์žฌ๋กœ์ฌ ์šฐ๋ฐœ์  ์ค‘๋ณต์ธ ๊ฒฝ์šฐ๊ฐ€ ๋” ๋งŽ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.)
    • ํ•˜์ง€๋งŒ (์ €์žฅ & ์ˆ˜์ •), (์กฐํšŒ1 & ์กฐํšŒ2)์˜ ๊ฒฝ์šฐ์—” ์ค‘๋ณต ๋กœ์ง์ด ํฌํ•จ๋œ ๊ฒฝ์šฐ๊ฐ€ ๋งŽ์„ ๊ฐ€๋Šฅ์„ฑ์ด ๋†’๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.
      • '์˜์กดํ•˜๋Š” ๋นˆ๋„ ๊ฑฐ๊ธฐ์„œ ๊ฑฐ๊ธฐ์ผ ๊ฒƒ ๊ฐ™์•„ ํ•ฉ์น˜๋Š” ๊ฒŒ ํด๋ž˜์Šค ์ˆ˜๋ฅผ ์ค„์ด๋Š” ์ธก๋ฉด์—์„œ๋„ ํ•ฉ๋ฆฌ์ ์ด์ง€ ์•Š์„๊นŒ?' ๋ผ๋Š” ์ƒ๊ฐ์ด์—ˆ์Šต๋‹ˆ๋‹ค.
      • ๋‹ค๋งŒ ์ด๋Ÿฌ๋ฉด ๋˜ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค ์ž‘์„ฑํ•  ๋•Œ ๋‚ด๋ถ€ ํด๋ž˜์Šค๊ฐ€ ๋“ฑ์žฅํ•ด์•ผ ํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. (๋‹จ, ์ด์ „์ฒ˜๋Ÿผ ๋ถ„๋ฆฌํ•ด์„œ ์–ป๋Š” ํŒจ๋„ํ‹ฐ๊ฐ€ ํฌ์ง„ ์•Š์Œ)
    • ๊ฐ™์€ ๊ฒ€์ƒ‰ ๊ธฐ๋Šฅ์ด๋ผ๋„ Actor๊ฐ€ ๋ˆ„๊ตฌ๋ƒ์— ๋”ฐ๋ผ ์šฐ๋ฐœ์  ์ค‘๋ณต์ผ ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ๋ถ„๋ฆฌ๊ฐ€ ํ•„์š”ํ•˜์ง€๋งŒ, ์ง€๊ธˆ์€ ๋”ฑํžˆ ๊ทธ๋Ÿฐ ๊ฒฝ์šฐ๋Š” ์—†๋Š” ๊ฑฐ ๊ฐ™๊ธฐ๋„ ํ–ˆ์–ด์š”.
  3. Service์˜ ๋ฉ”์„œ๋“œ ๋ช…์ด execute()์ธ ๊ฒฝ์šฐ
    • ํด๋ž˜์Šค๋ช…์ด ๊ณง ๋ชจ๋“  ์—ญํ• ์„ ๋‚˜ํƒ€๋‚ด๋ฉฐ, ๋‹จ ํ•˜๋‚˜์˜ ๋ฉ”์„œ๋“œ๋งŒ์„ ์ œ๊ณตํ•˜๋Š” ๊ฒฝ์šฐ์ž…๋‹ˆ๋‹ค.
      • TargetAmountDeleteService.deleteTargetAmount()๋Š” ๋„ˆ๋ฌด ๋ง์žฅ๋‚œ ๊ฐ™์•„์„œ
    • ์ง๊ด€์ ์ด๋ผ ์ข‹์ง€ ์•Š์„๊นŒ ์ƒ๊ฐ ํ–ˆ๋Š”๋ฐ, ๊ธฐ์กด ์ปจ๋ฒค์…˜์— ์–ด๊ธ‹๋‚˜์„œ ์ด์•ผ๊ธฐ ํ•ด๋ณด๊ณ  ์‹ถ์–ด์š”.
  4. Mapper๊ฐ€ UseCase์— ์œ„์น˜ํ•œ ๊ฒฝ์šฐ์™€ Service์— ์œ„์น˜ํ•œ ๊ฒฝ์šฐ.
    • Mapper๊ฐ€ ํ•„์š”ํ•œ ์‘๋‹ต๊ฐ’์ด ๋‘ ๊ฐœ ์ด์ƒ์ธ ๊ฒฝ์šฐ์— ํ•ด๋‹นํ•ฉ๋‹ˆ๋‹ค. (ex. TargetAmount ์ •๋ณด์™€ Spending ์ •๋ณด๊ฐ€ ๋ชจ๋‘ ํ•„์š”ํ•œ ๊ฒฝ์šฐ)
    • ์ฐจ๋ผ๋ฆฌ TargetAmountSearchService์™€ SpendingSearchService๋ฅผ ๋ถ„๋ฆฌํ•˜๋Š” ๊ฒŒ ๋‚˜์„๊นŒ์š”?

๋ฐœ๊ฒฌํ•œ ์ด์Šˆ

  • ์—†์Œ.

@psychology50 psychology50 added the refactoring ๋ฆฌํŒฉํ† ๋ง ์ž‘์—… label Jun 12, 2024
@psychology50 psychology50 self-assigned this Jun 12, 2024
@psychology50 psychology50 changed the title Fix/target amount usecase refactor ๐Ÿ”ง ๋ชฉํ‘œ ๊ธˆ์•ก ์œ ์ฆˆ ์ผ€์ด์Šค ๋ฆฌํŒฉํ† ๋ง Jun 12, 2024
@psychology50
Copy link
Member Author

Mapper ๊ด€๋ จํ•ด์„œ TargetAmountSearchService์™€ SpendingSearchService๋ฅผ ๋ถ„๋ฆฌํ•˜๋Š” ๊ฒŒ ์–ด๋–ค ์˜๋ฏธ์ธ์ง€ ์ดํ•ดํ•˜๊ธฐ ํž˜๋“œ์‹ค ์ˆ˜ ์žˆ์„ ๊ฑฐ ๊ฐ™์•„ ์ถ”๊ฐ€ ์„ค๋ช…ํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

image

TargetAmountSearchService์—์„œ ๋‘ ๊ฐœ์˜ ๋ฐ์ดํ„ฐ๋ฅผ ๋ชจ๋‘ ์กฐํšŒํ•˜๋ ค ํ•˜์ง€ ์•Š๊ณ , ์„œ๋น„์Šค๋ฅผ ๋‘˜๋กœ ๋‚˜๋ˆ„์–ด UseCase์—์„œ ๊ฐ๊ฐ์— ๋Œ€ํ•œ ์š”์ฒญ์— ๋Œ€ํ•œ ์‘๋‹ต์„ ๋ฐ›์Šต๋‹ˆ๋‹ค.
๊ทธ ๋‹ค์Œ Mapper๋กœ ๋ฌถ์–ด์ค€๋‹ค๋ฉด Service์—์„œ Mapper๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฑธ ๋ฐฉ์ง€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator

@asn6878 asn6878 left a comment

Choose a reason for hiding this comment

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

  1. PR ์ ‘๋‘์‚ฌ์— Api:๋ฅผ ๋ถ™์ด์ง€ ์•Š์€ ์ด์œ 
  2. ์™œ Service ํด๋ž˜์Šค๋ฅผ ๋‚˜๋ˆ„๋‹ค๊ฐ€ ๋ง์•˜๋Š”์ง€์— ๋Œ€ํ•ด์„œ

์ดํ•ด ํ–ˆ์Šต๋‹ˆ๋‹ค. ๋™์˜ํ•ฉ๋‹ˆ๋‹ค!

  1. Service์˜ ๋ฉ”์„œ๋“œ ๋ช…์ด execute()์ธ ๊ฒฝ์šฐ

๊ถ๊ธˆํ•œ์  ํ•˜๋‚˜ ๋‚จ๊ฒจ๋‘์—ˆ์Šต๋‹ˆ๋‹ค. ๋‹ต๋ณ€ํ•ด์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!

  1. Mapper๊ฐ€ UseCase์— ์œ„์น˜ํ•œ ๊ฒฝ์šฐ์™€ Service์— ์œ„์น˜ํ•œ ๊ฒฝ์šฐ.

์ฝ”๋ฉ˜ํŠธ์—์„œ ๋ง์”€ํ•ด์ฃผ์‹  ๋Œ€๋กœ ๋ถ„๋ฆฌํ•œ๋‹ค๊ณ  ํ•˜๋ฉด Service์—์„œ Mapper๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š์•„๋„ ๋˜๋Š”๊ฒƒ์„ ์ดํ•ดํ–ˆ์Šต๋‹ˆ๋‹ค.
ํ•˜์ง€๋งŒ ์ถ”ํ›„์— ๋กœ์ง์ด ๋ณต์žกํ•ด์ง€๋ฉด ๊ทธ๋งŒํผ ๋ถ„๋ฆฌํ•  Service๋„ ๋งŽ์•„์ ธ ๋ณต์žก์„ฑ์ด ์˜ฌ๋ผ๊ฐˆ ์œ„ํ—˜์ด ์žˆ์–ด๋ณด์ž…๋‹ˆ๋‹ค.

๊ทธ๋Ÿฌ๋ฏ€๋กœ ๋ฐ˜๋Œ€๋กœ Service์—์„œ Mapper์‚ฌ์šฉ์„ ๋ฐฉ์ง€ํ•ด์•ผ ํ•˜๋Š” ์ด์œ ์— ๋Œ€ํ•ด์„œ ์ œ๊ฐ€ ์ดํ•ด๊ฐ€ ๋ถ€์กฑํ•œ ๊ฒƒ ๊ฐ™์•„์„œ ์กฐ๊ธˆ๋งŒ ๋” ์„ค๋ช…ํ•ด์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค ๐Ÿ˜„

@psychology50
Copy link
Member Author

  1. Mapper๊ฐ€ UseCase์— ์œ„์น˜ํ•œ ๊ฒฝ์šฐ์™€ Service์— ์œ„์น˜ํ•œ ๊ฒฝ์šฐ.

์ฝ”๋ฉ˜ํŠธ์—์„œ ๋ง์”€ํ•ด์ฃผ์‹  ๋Œ€๋กœ ๋ถ„๋ฆฌํ•œ๋‹ค๊ณ  ํ•˜๋ฉด Service์—์„œ Mapper๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š์•„๋„ ๋˜๋Š”๊ฒƒ์„ ์ดํ•ดํ–ˆ์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์ถ”ํ›„์— ๋กœ์ง์ด ๋ณต์žกํ•ด์ง€๋ฉด ๊ทธ๋งŒํผ ๋ถ„๋ฆฌํ•  Service๋„ ๋งŽ์•„์ ธ ๋ณต์žก์„ฑ์ด ์˜ฌ๋ผ๊ฐˆ ์œ„ํ—˜์ด ์žˆ์–ด๋ณด์ž…๋‹ˆ๋‹ค.

๊ทธ๋Ÿฌ๋ฏ€๋กœ ๋ฐ˜๋Œ€๋กœ Service์—์„œ Mapper์‚ฌ์šฉ์„ ๋ฐฉ์ง€ํ•ด์•ผ ํ•˜๋Š” ์ด์œ ์— ๋Œ€ํ•ด์„œ ์ œ๊ฐ€ ์ดํ•ด๊ฐ€ ๋ถ€์กฑํ•œ ๊ฒƒ ๊ฐ™์•„์„œ ์กฐ๊ธˆ๋งŒ ๋” ์„ค๋ช…ํ•ด์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค ๐Ÿ˜„

์ผ๋‹จ Service์—์„œ Mapper ์‚ฌ์šฉ์„ ํ•˜์ง€ ์•Š๊ฒŒ ๋งŒ๋“œ๋Š” ๊ฒƒ์ด ์ฃผ ๋ชฉ์ ์€ ์•„๋‹ˆ์—ˆ์Šต๋‹ˆ๋‹ค.
๊ทธ์ € ์„ค๊ณ„ ์›์น™์„ ์ค€์ˆ˜ํ–ˆ์„ ๋•Œ, ์ž์—ฐ์Šค๋ ˆ ๊ทธ๋ฆฌ ๋˜๋Š” ๊ฑฐ๋ผ ์ƒ๊ฐํ–ˆ์–ด์š”.

ํ˜„์žฌ ๋ชฉํ‘œ ๊ธˆ์•ก ์กฐํšŒ ์‹œ, ๋ฐ˜ํ™˜ํ•˜๋Š” ๋ฐ์ดํ„ฐ๋Š” ๋ชฉํ‘œ ๊ธˆ์•ก๊ณผ ์›” ๋ณ„ ์ง€์ถœ ๋‚ด์—ญ ์ด์•ก์ด ๋ฉ๋‹ˆ๋‹ค.
๊ทธ๋Ÿฐ๋ฐ ๊ณผ์—ฐ ๋ชฉํ‘œ ๊ธˆ์•ก ์กฐํšŒ ์„œ๋น„์Šค์—์„œ "์ง€์ถœ ๋‚ด์—ญ(Spending)"์˜ ๋ฐ์ดํ„ฐ๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๊ฒƒ์ด ๋งž์„๊นŒ? ์ด ๋‘˜์„ ๋”ฐ๋กœ ๋ถ„๋ฆฌํ•˜๊ณ  UseCase์—์„œ Mapper๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ๋‘ ๊ฐœ์˜ ์ด์งˆ์ ์ธ ๋ฐ์ดํ„ฐ๋ฅผ ๋ฌถ์–ด์ฃผ๋Š” ๊ฒƒ์ด ์˜ฌ๋ฐ”๋ฅด์ง€ ์•Š์„๊นŒ? ๋ผ๋Š” ์ƒ๊ฐ์ด ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค.
์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ๋‹จ์œ„ ํ…Œ์ŠคํŠธ ๋˜ํ•œ ๋ช…๋ฃŒํ•ด์ง‘๋‹ˆ๋‹ค. ๋ชฉํ‘œ ๊ธˆ์•ก ๋ฐ์ดํ„ฐ๊ฐ€ ์ž˜ ์กฐํšŒ๋˜๋Š”์ง€ ํ™•์ธํ•˜๋Š”๋ฐ, ์›”๋ณ„ ์ง€์ถœ ๋‚ด์—ญ ์ด์•ก์˜ ์‹คํŒจ๊ฐ€ ๋œฐ ์ผ์ด ์—†์–ด์ง€๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

ํ˜น์‹œ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”??

  • ๋ณต์žก๋„ ๋ฌธ์ œ
    ์ €๋„ ์ด ๋ฌธ์ œ ๋•Œ๋ฌธ์— ์ฒ˜์Œ์— ํŒŒ์‚ฌ๋“œ ํŒจํ„ด์„ ์ž˜๋ชป ์ ์šฉํ•˜๊ณ  ์žˆ๋Š” ๊ฑฐ์˜€๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ํด๋ž˜์Šค ์ˆ˜๊ฐ€ ๋„ˆ๋ฌด ๋งŽ์•„์ง€๋Š”๋ฐ, ์—ฌ๊ธฐ์— ๋“ค์–ด๊ฐ€๋Š” ๋น„์šฉ์ด ๋” ํฌ์ง€ ์•Š์„ ์ง€ ์šฐ๋ ค์Šค๋Ÿฌ์› ์œผ๋‹ˆ๊นŒ์š”.
    ๊ทธ๋Ÿฌ๋‚˜ ํด๋ž˜์Šค ์ˆ˜๊ฐ€ ๋Š˜์–ด๋‚˜๋Š” ๊ฒŒ ๋‘๋ ค์›Œ ์ž˜๋ชป๋œ ์„ค๊ณ„๋ฅผ ํ•œ ๋‚˜๋จธ์ง€, ํ˜„์žฌ ์˜คํžˆ๋ ค ํ•˜๋‚˜์˜ ํด๋ž˜์Šค์— ๋‹จ์ผ ์ฑ…์ž„ ์›์น™์ด ์ง€์ผœ์ง€์ง€ ์•Š์•„ ๋”๋”์šฑ ํ”„๋กœ๋•ํŠธ ์ฝ”๋“œ์™€ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๊ฒƒ์— ๋งŽ์€ ์–ด๋ ค์›€๊ณผ ์‹œ๊ฐ„์ด ๋“ค๊ณ  ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ์Šต๋‹ˆ๋‹ค.

์ฐจ๋ผ๋ฆฌ ๊ด€๋ฆฌํ•ด์•ผ ํ•  ํด๋ž˜์Šค๊ฐ€ ์กฐ๊ธˆ ๋Š˜๋”๋ผ๋„, ๋ช…์‹œ์ ์œผ๋กœ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค๋ฉด ์˜คํžˆ๋ ค ์ด๋“์ด ์•„๋‹๊นŒ.....๋ผ๋Š” ๊ณ ๋ฏผ ์ค‘...
๊ทธ๋ฆฌ๊ณ  ํ•ด๋ด์•ผ ๋„๋ฉ”์ธ ๋‹น 3~4๊ฐœ์˜ ํด๋ž˜์Šค ์ •๋„๊ฐ€ ์ƒ์„ฑ๋  ๊ฑฐ๋ผ ์ƒ๊ฐํ•ด์„œ ๋‚˜์˜์ง€ ์•Š์„ ๊ฒƒ ๊ฐ™๊ธฐ๋„ ํ–ˆ๊ตฌ์š”!

@asn6878
Copy link
Collaborator

asn6878 commented Jun 23, 2024

ํ˜„์žฌ ๋ชฉํ‘œ ๊ธˆ์•ก ์กฐํšŒ ์‹œ, ๋ฐ˜ํ™˜ํ•˜๋Š” ๋ฐ์ดํ„ฐ๋Š” ๋ชฉํ‘œ ๊ธˆ์•ก๊ณผ ์›” ๋ณ„ ์ง€์ถœ ๋‚ด์—ญ ์ด์•ก์ด ๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ๊ณผ์—ฐ ๋ชฉํ‘œ ๊ธˆ์•ก ์กฐํšŒ ์„œ๋น„์Šค์—์„œ "์ง€์ถœ ๋‚ด์—ญ(Spending)"์˜ ๋ฐ์ดํ„ฐ๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๊ฒƒ์ด ๋งž์„๊นŒ? ์ด ๋‘˜์„ ๋”ฐ๋กœ ๋ถ„๋ฆฌํ•˜๊ณ  UseCase์—์„œ Mapper๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ๋‘ ๊ฐœ์˜ ์ด์งˆ์ ์ธ ๋ฐ์ดํ„ฐ๋ฅผ ๋ฌถ์–ด์ฃผ๋Š” ๊ฒƒ์ด ์˜ฌ๋ฐ”๋ฅด์ง€ ์•Š์„๊นŒ? ๋ผ๋Š” ์ƒ๊ฐ์ด ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ๋‹จ์œ„ ํ…Œ์ŠคํŠธ ๋˜ํ•œ ๋ช…๋ฃŒํ•ด์ง‘๋‹ˆ๋‹ค. ๋ชฉํ‘œ ๊ธˆ์•ก ๋ฐ์ดํ„ฐ๊ฐ€ ์ž˜ ์กฐํšŒ๋˜๋Š”์ง€ ํ™•์ธํ•˜๋Š”๋ฐ, ์›”๋ณ„ ์ง€์ถœ ๋‚ด์—ญ ์ด์•ก์˜ ์‹คํŒจ๊ฐ€ ๋œฐ ์ผ์ด ์—†์–ด์ง€๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

ํ˜น์‹œ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”??

์งˆ๋ฌธ์— ๋‹ต๋ณ€ํ•ด์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ๊ณ„์† ๋Š๋ผ๋Š”๊ฑฐ์ง€๋งŒ ์ด๋ฒˆ ๋ฆฌํŒฉํ† ๋ง์€ ํ…Œ์ŠคํŠธ๋ฅผ ์ƒ๊ฐํ•ด๋ณด๋ฉด ์•ˆ๋ณด์ด๋˜ ๋ฌธ์ œ๋“ค์ด ๋ณด์ด๋„ค์š”ใ…Ž

๊ทธ๋Ÿฌ๋‚˜ ํด๋ž˜์Šค ์ˆ˜๊ฐ€ ๋Š˜์–ด๋‚˜๋Š” ๊ฒŒ ๋‘๋ ค์›Œ ์ž˜๋ชป๋œ ์„ค๊ณ„๋ฅผ ํ•œ ๋‚˜๋จธ์ง€, ํ˜„์žฌ ์˜คํžˆ๋ ค ํ•˜๋‚˜์˜ ํด๋ž˜์Šค์— ๋‹จ์ผ ์ฑ…์ž„ ์›์น™์ด ์ง€์ผœ์ง€์ง€ ์•Š์•„ ๋”๋”์šฑ ํ”„๋กœ๋•ํŠธ ์ฝ”๋“œ์™€ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๊ฒƒ์— ๋งŽ์€ ์–ด๋ ค์›€๊ณผ ์‹œ๊ฐ„์ด ๋“ค๊ณ  ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ์Šต๋‹ˆ๋‹ค.

์ €๋„ ํด๋ž˜์Šค ๊ฐœ์ˆ˜์˜ ์ฆ๊ฐ€ VS ๋‹จ์ผ ์ฑ…์ž„ ์›์น™ ์œ„๋ฐฐ์˜ ์ž„์‹œ์  ํ—ˆ์šฉ ์„ ๊ธฐ์ค€์œผ๋กœ ๋น„๊ต๋ฅผ ํ•ด๋ณด๋ฉด ๊ณ ๋ฏผ ์—†์ด ์ „์ž๋ฅผ ํƒํ•  ๊ฒƒ ๊ฐ™๋„ค์š”.
๋ธ”๋กœ๊ทธ ํฌ์ŠคํŒ…์—๋„ ์“ฐ์…จ๋“ฏ ์–ธ์  ๊ฐ€ ๋˜ ์ด ๋ฐฉ๋ฒ•์˜ ์•ฝ์ ์„ ์ฐพ๊ฒŒ ๋ ํ…Œ๋‹ˆ, ๊ทธ๋•Œ๊นŒ์ง€ ์ด๋ ‡๊ฒŒ ํ•ด๋ด๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™๋‹ค๋Š” ์ƒ๊ฐ์ž…๋‹ˆ๋‹ค~

@psychology50
Copy link
Member Author

๋ธ”๋กœ๊ทธ ํฌ์ŠคํŒ…์—๋„ ์“ฐ์…จ๋“ฏ ์–ธ์  ๊ฐ€ ๋˜ ์ด ๋ฐฉ๋ฒ•์˜ ์•ฝ์ ์„ ์ฐพ๊ฒŒ ๋ ํ…Œ๋‹ˆ, ๊ทธ๋•Œ๊นŒ์ง€ ์ด๋ ‡๊ฒŒ ํ•ด๋ด๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™๋‹ค๋Š” ์ƒ๊ฐ์ž…๋‹ˆ๋‹ค~

ํ˜น์‹œ "์ด๋ ‡๊ฒŒ"๊ฐ€ ํ˜„์ƒ ์œ ์ง€๋ฅผ ๋ง์”€ํ•˜์‹œ๋Š” ๊ฑธ๊นŒ์š”, ์•„๋‹˜ ๋ถ„๋ฆฌํ•œ ๊ฑธ ๋ง์”€ํ•˜์‹œ๋Š” ๊ฑธ๊นŒ์š”? ใ…Žใ…Ž

@asn6878
Copy link
Collaborator

asn6878 commented Jun 23, 2024

ํ˜น์‹œ "์ด๋ ‡๊ฒŒ"๊ฐ€ ํ˜„์ƒ ์œ ์ง€๋ฅผ ๋ง์”€ํ•˜์‹œ๋Š” ๊ฑธ๊นŒ์š”, ์•„๋‹˜ ๋ถ„๋ฆฌํ•œ ๊ฑธ ๋ง์”€ํ•˜์‹œ๋Š” ๊ฑธ๊นŒ์š”? ใ…Žใ…Ž

๋ถ„๋ฆฌํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์จ๋ณด์ž๋Š” ๋ง์ด์—ˆ์Šต๋‹ˆ๋‹ค!

@psychology50
Copy link
Member Author

๋ถ„๋ฆฌํ•ด๋ดค๋Š”๋ฐ, ๋‹ค์‹œ ํ•œ ๋ฒˆ ๋ฆฌ๋ทฐ ๋ถ€ํƒ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring ๋ฆฌํŒฉํ† ๋ง ์ž‘์—…
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants