refactoring to patterns - andstudy/forge GitHub Wiki

์ฐธ๊ฐ€์ž

  1. ์ด๋™ํ˜„
  2. ์ •ํฌ์ข…
  3. ์•ˆ์ค€์„
  4. ๋ฐ•์ฃผํฌ
  5. ๋งˆ์•ผ - ๊ณ ๋ณด์„ฑ
  6. ์žฌ๊ฐ€๋‹ˆ - ๊น€์žฌ๊ด€
  7. ๊นจ์ก - ์ตœ์ค€ํ˜ธ3
  8. ๊น€๊ฒฝ๋ ฌ
  9. ๊ณ ์šฉ์ค€
  10. ๊ฐ•๋Œ€๋ช…
  11. ๊ตฌ๋ฃจ - ๋ฐ•์ง„์šฑ
  12. ์ง€๊ธˆ์–ด๋•Œ - ์˜ค์ƒ๋ฏผ
  13. ์ด์ •๋ฏผ
  14. ์ดˆ์ฝ”๋กœ - ์„œ์ •ํ˜ธ
  15. ๊น€๋ช…๊ด€ -
  16. ๋ฐ•์ง„ํ˜ธ
  17. ๊น€๊ด‘ํ›ˆ
  18. ๋น›์˜์ž๋…€ -
  19. ์ญ์ด -

ํšŒ๋น„๋‚ฉ๋ถ€ ๋‚ด์—ญ

๋‚ ์งœ ๋‚ด์—ญ ๊ธˆ์•ก
4์›” 12์ผ ๊น€๊ฒฝ๋ ฌ, ๋ฐ•์ฃผํฌ 80,000 ์›
4์›” 19์ผ ์ด๋™ํ˜„, ์ •ํฌ์ข…, ๊น€๊ด‘ํ›ˆ, ์„œ์ •ํ˜ธ, ์˜ค์ƒ๋ฏผ, ๊น€์žฌ๊ด€, ์ตœ์ค€ํ˜ธ, ๊ณ ๋ณด์„ฑ, ๊ฐ•๋Œ€๋ช…, ๋ฐ•์ง„์šฑ, ์•ˆ์ค€์„ 440,000 ์›
4์›” 26์ผ ๊น€๋ช…๊ด€, ๊ณ ์šฉ์ค€, ๋ฐ•์ง„ํ™ 120,000 ์›
5์›” 31์ผ ์ด์ •๋ฏผ 40,000 ์›
์ด์•ก - 680,000 ์›
๋‚ด์—ญ ์ž…๊ธˆ ์ถœ๊ธˆ
ํšŒ๋น„ ์ž…๊ธˆ์•ก 680,000์›
4์›” 12์ผ ํ† ์ฆˆ ๋น„์šฉ 36,000์›
4์›” 19์ผ ํ† ์ฆˆ ๋น„์šฉ 50,400์›
4์›” 26์ผ ํ† ์ฆˆ ๋น„์šฉ 50,400์›
5์›” 3์ผ ํ† ์ฆˆ ๋น„์šฉ 56,000์›
5์›” 10์ผ ํ† ์ฆˆ ๋น„์šฉ 50,400์›
5์›” 17์ผ ํ† ์ฆˆ ๋น„์šฉ 50,400์›
5์›” 24์ผ ํ† ์ฆˆ ๋น„์šฉ 50,400์›
5์›” 31์ผ ํ† ์ฆˆ ๋น„์šฉ 50,400์›
6์›” 7์ผ ํ† ์ฆˆ ๋น„์šฉ 50,400์›
6์›” 7์ผ ์ฑ…๊ฑธ์ด ๋น„์šฉ 130,000์›
---------------------------------
์†Œ ๊ณ„ 524,400์›
=================================
์ด ๊ณ„ 155,600 ์›

๋ฐœํ‘œ ์ˆœ์„œ

  • 4์›” 19์ผ

    • ch1.์•ˆ์ค€์„
    • ch2. ์•ˆ์ค€์„
    • ch3. ์ด๋™ํ˜„
    • ch4. ์ •ํฌ์ข…
  • 4์›” 26์ผ

    1. ๋ฐ•์ฃผํฌ - Replace constructors with Creation Methods
    2. ๊ณ ๋ณด์„ฑ - Chain Constructors
    3. ์ตœ์ฃผํฌ - Encapsulate Classes with Factory
    4. ๊น€์žฌ๊ด€ - Introduce Polymorphic Creation With Factory Method
  • 5์›” 3์ผ

    1. ์ด์ •๋ฏผ - Replace Conditional Logic with Strategy
    2. ๊ณ ์šฉ์ค€ - Form Template Method
    3. ๊ฐ•๋Œ€๋ช… - Compose Method
    4. ๋ฐ•์ง„์šฑ - Replace Implicit Tree with Composite
  • 5์›” 10์ผ

    1. ์˜ค์ƒ๋ฏผ - Encapsulate Composite with Builder
    2. ๊น€๊ฒฝ๋ ฌ - Move Accumulation to Collecting Parameter
    3. ์„œ์ •ํ˜ธ - Extract Composite
    4. ๊น€๋ช…๊ด€ - Replace One/Many Distinctions with Composite
  • 5์›” 17์ผ

    1. ๋ฐ•์ง„ํ˜ธ - Extract Adapter
    2. ๊น€๊ด‘ํ›ˆ - Unify Interfaces with Adapter
  • 5์›” 24์ผ

    1. ๊ฐ•๋Œ€๋ช… - Replace Conditional Dispatcher with Command
    2. ์˜ค์ƒ๋ฏผ - Replace Type Code with Class
    3. ์ •ํฌ์ข… - Replace State-Altering Conditionals with State
    4. ๋ฐ•์ฃผํฌ - Introduce Null Object
    5. ๋ฐ•์ง„ํ˜ธ - Inline Singleton
    6. ๋ฐ•์ง„ํ˜ธ - Unify Interfaces
  • 5์›” 31์ผ

    1. ์ด์ •๋ฏผ - Limit Instantiation with Singleton
    2. ๋ฐ•์ง„์šฑ - Replace Hard-Coded Notifications with Observer
    3. ์ด๋™ํ˜„ - Move Embellishment to Decorator
  • 6์›” 7์ผ

    1. ์ตœ์ค€ํ˜ธ - Extract Parameter
    2. ๊น€๊ฒฝ๋ ฌ - Move Creation Knowledge to Factory
    3. ์„œ์ •ํ˜ธ - Move Accumulation to Visitor
    4. ๊น€๊ด‘ํ›ˆ - Replace Implicit Language with Interpreter