SOLID

Robert C. Martin ์ด 2000๋…„๋Œ€ ์ดˆ ๋ช…๋ช…ํ•œ ๊ฐ์ฒด์ง€ํ–ฅ์˜ ๋‹ค์„ฏ๊ฐ€์ง€ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ๋ฐ ์„ค๊ณ„์˜ ์›์น™๋“ค์„ ๋‘๋ฌธ์ž์–ด ๊ธฐ์–ต์ˆ ๋กœ ์†Œ๊ฐœํ•œ๊ฒƒ์ด๋‹ค.

์ด๋Š” ๊ฐ์ฒด์ง€ํ–ฅ 4๋Œ€ ํŠน์„ฑ์ธ ์บก์Šํ™”, ์ƒ์†, ์ถ”์ƒํ™”, ๋‹คํ˜•์„ฑ ๋“ฑ์„ ์ด์šฉํ•˜์—ฌ ๊ฐ์ฒด์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์„ค๊ณ„๋ฅผ ๋„์™€์ฃผ๋Š” ์›์น™๋“ค์ด ์žˆ๋‹ค.

์ž๊ธฐ ์ž์‹ ์˜ ํด๋ž˜์Šค์˜ ์‘์ง‘๋„๋ฅผ ๋†’์ด๊ณ , ํƒ€ ํด๋ž˜์Šค์˜ ๊ฒฐํ•ฉ๋„๋ฅผ ๋‚ฎ์ถ”๋Š” (High-Cohesion - Loose Coupling) ์›์น™์„ ๊ฐ์ฒด ์ง€ํ–ฅ๊ด€์ ์—์„œ ๋„์ž…ํ•œ๊ฒƒ์ด๋‹ค.

SOLID 5๋Œ€ ์›์น™ (๊ฐ์ฒด ์ง€ํ–ฅ ์„ค๊ณ„ 5์›์น™)

  • SRP (Single Reponsibility Principle : ๋‹จ์ผ ์ฑ…์ž„์˜ ์›์น™)
  • OCP (Open Closed Principle : ๊ฐœ๋ฐฉ ํ์‡„์˜ ์›์น™)
  • LSP (Liskov Substitution Principle : ๋ฆฌ์Šค์ฝ”ํ”„ ์น˜ํ™˜์˜ ์›์น™)
  • ISP (Interface Segregation Principle : ์ธํ„ฐํŽ˜์ด์Šค ๋ถ„๋ฆฌ์˜ ์›์น™)
  • DIP (Dependency Inversion Principle : ์˜์กด ์—ญ์ „์˜ ์›์น™)

๋‹จ์ผ ์ฑ…์ž„์˜ ์›์น™ (SRP : Single Reponsibility Principle)

์ž‘์„ฑ๋œ ํด๋ž˜์Šค๋Š” ํ•˜๋‚˜์˜ ๊ธฐ๋Šฅ๋งŒ ๊ฐ€์ง€๋ฉฐ ํด๋ž˜์Šค๊ฐ€ ์ œ๊ณตํ•˜๋Š” ๋ชจ๋“  ์„œ๋น„์Šค๋Š” ๊ทธ ํ•˜๋‚˜์˜ ์ฑ…์ž„์„ ์ˆ˜ํ–‰ํ•˜๋Š”๋ฐ ์ง‘์ค‘ ๋˜์–ด์•ผ ํ•œ๋‹ค๋Š”๊ฒƒ

  • ์†Œํ”„ํŠธ์›จ์–ด์˜ ์„ค๊ณ„ ๋ถ€ํ’ˆ (ํด๋ž˜์Šค, ํ•จ์ˆ˜) ๋Š” ๋‹จ ํ•˜๋‚˜์˜ ์ฑ…์ž„ (๊ธฐ๋Šฅ) ๋งŒ ๊ฐ€์ ธ์•ผ ํ•œ๋‹ค.

์ƒˆ๋กœ์šด ์š”๊ตฌ์‚ฌํ•ญ์— ๋Œ€ํ•ด ํ”„๋กœ๊ทธ๋žจ์ด ์˜ํ–ฅ ๋ฐ›๋Š” ๋ถ€๋ถ„์ด ์ ์–ด์•ผ ํ•œ๋‹ค. ๋‹ค์‹œ ๋งํ•˜๋ฉด ์‘์ง‘๋„๋Š” ๋†’๊ณ  ๊ฒฐํ•ฉ๋„๋Š” ๋‚ฎ์•„์•ผ ํ•œ๋‹ค ๋ผ๋Š” ๋ง์ด๋‹ค.
๋งŒ์•ฝ ํ•œ ํ”„๋กœ๊ทธ๋žจ์ด ์ฑ…์ž„(๊ธฐ๋Šฅ์„ ๋‹ด๋‹น) ์ง€๊ณ  ์žˆ๋Š” ๋ถ€๋ถ„์ด ๋งŽ์•„์ง€๋ฉด ํด๋ž˜์Šค ๋‚ด๋ถ€์˜ ํ•จ์ˆ˜๋ผ๋ฆฌ ๊ฐ•ํ•œ ๊ฒฐํ•ฉ๋„๋ฅผ ๊ฐ€์งˆ์ˆ˜ ์žˆ๋Š” ๊ฐ€๋Šฅ์„ฑ์ด ๋†’๊ธฐ ๋•Œ๋ฌธ์— ์š”๊ตฌ์‚ฌํ•ญ์˜ ์ˆ˜์ •์ด ๋ฐœ์ƒํ•  ๊ฒฝ์šฐ ์œ ์ง€๋ณด์ˆ˜ ๋น„์šฉ์ด ์ฆ๊ฐ€ํ•œ๋‹ค.
๋”ฐ๋ผ์„œ ์ฑ…์ž„ (๊ธฐ๋Šฅ) ์„ ๋ถ„๋ฆฌ ํ•  ์ˆ˜ ์žˆ๋Š” ๊ตฌ์กฐ๋กœ ์„ค๊ณ„๋˜์–ด์•ผ ํ•œ๋‹ค.

๋ฆฌํŒฉํ† ๋ง (Refactoring) ์„ ํ†ตํ•˜์—ฌ ํ•ด๋‹น ์ฑ…์ž„์„ ์ตœ์ƒ์˜ ์ƒํƒœ๋กœ ๋ถ„๋ฐฐ

๊ฐœ๋ฐฉ ํ์‡„ ์›์น™ (OCP : Open Closed Principle)

์†Œํ”„ํŠธ์›จ์–ด์˜ ๊ตฌ์„ฑ์š”์†Œ (์ปดํฌ๋„ŒํŠธ, ํด๋ž˜์Šค, ๋ชจ๋“ˆ, ํ•จ์ˆ˜) ๋Š” ํ™•์žฅ์—๋Š” ์—ด๋ ค ์žˆ๊ณ , ๋ณ€๊ฒฝ์—๋Š” ๋‹ซํ˜€ ์žˆ์–ด์•ผ ํ•œ๋‹ค๋Š” ์˜๋ฏธ์ด๋‹ค.
๊ธฐ์กด์˜ ๊ตฌ์„ฑ์š”์†Œ๋Š” ์ˆ˜์ •์ด ์ผ์–ด๋‚˜์ง€ ๋ง์•„์•ผ ํ•˜๋ฉฐ, ๊ธฐ์กด์˜ ๊ตฌ์†Œ์š”์†Œ๋ฅผ ์‰ฝ๊ฒŒ ํ™•์žฅํ•˜์—ฌ ์žฌ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•ด์•ผ ํ•œ๋‹ค๋Š” ๋œป์ด๋‹ค.

  • ํ™•์žฅ ๋ ๊ฒƒ๊ณผ ๋ถˆ๋ณ€์˜ ์†์„ฑ์„ ์—„๊ฒฉํžˆ ๊ตฌ๋ถ„ํ•œ๋‹ค.
  • ๋‘ ๋ชจ๋“ˆ์ด ๋งŒ๋‚˜๋Š” ์ง€์ ์— ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ •์˜ํ•œ๋‹ค.
  • ๊ตฌํ˜„์— ์˜์กดํ•˜๊ธฐ๋ณด๋‹ค ์ •์˜ํ•œ ์ธํ„ฐํŽ˜์ด์Šค์— ์˜์กดํ•˜๋„๋ก ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•œ๋‹ค.

์ •์˜

  • ์†Œํ”„ํŠธ์›จ์–ด์˜ ๊ตฌ์„ฑ์š”์†Œ (์ปดํฌ๋„ŒํŠธ, ํด๋ž˜์Šค, ๋ชจ๋“ˆ, ํ•จ์ˆ˜) ๋Š” ํ™•์žฅ์—๋Š” ์—ด๋ ค ์žˆ๊ณ , ๋ณ€๊ฒฝ์—๋Š” ๋‹ซํ˜€ ์žˆ์–ด์•ผ ํ•œ๋‹ค.

์ด๋Š” ๊ธฐ์กด์˜ ๊ตฌ์„ฑ์š”์†Œ๋Š” ์ˆ˜์ •์ด ์ผ์–ด๋‚˜์ง€ ๋ง์•„์•ผ ํ•˜๋ฉฐ, ๊ธฐ์กด์˜ ๊ตฌ์„ฑ์š”์†Œ๋ฅผ ์‰ฝ๊ฒŒ ํ™•์žฅํ•˜์—ฌ ์žฌ์‚ฌ์šฉ ๊ฐ€๋Šฅ ํ•ด์•ผ ํ•œ๋‹ค๋Š” ๋œป์ด๋ฉฐ, ํ”„๋กœ๊ทธ๋žจ ์„ค๊ณ„ ๊ณผ์ •์—์„œ ๋งŽ์€ ๊ณ ๋ฏผ์ด ๋˜์–ด ์žˆ์–ด์•ผ ํ•˜๊ณ  ์ด๋ฅผ ์œ„ํ•ด ์ž์ฃผ ์‚ฌ์šฉ๋˜๋Š” ๋ฌธ๋ฒ•์ด interface ๋ฅผ ํ™œ์šฉํ•œ ๋ฐฉ๋ฒ•์ด๋‹ค.

์•„๋ž˜ ์˜ˆ์‹œ๋ฅผ ํ†ตํ•˜์—ฌ OCP ์˜ ์œ„๋ฐฐ ์‚ฌํ•ญ์„ ์‚ดํŽด ๋ณด์ž

class SoundPlayer {
  void play() {
    System.out.println("play wav");
  }
}
public class Client {
  public static void main(String[] args) {
    SoundPlayer sp = new SoundPlayer();
    sp.play();
  }
}

์ƒ๊ธฐ ์ฝ”๋“œ์—์„œ play() ๋ฅผ ๋‹ค๋ฅธ ํŒŒ์ผ ํฌ๋งท์˜ ์žฌ์ƒ์„ ์›ํ•œ๋‹ค๋ฉด OCP ์›์น™์— ์œ„๋ฐฐ๋œ๋‹ค.

์ด๋Ÿฌํ•œ ๊ฒฝ์šฐ์—๋Š” interface ๋ฅผ ๊ตฌ์„ฑํ•˜์—ฌ OCP ๋ฅผ ๋งŒ์กฑํ•œ๋‹ค.

interface playAlgorithm {
  public void play();
}

class Wav implements playAlgorithm {
  @Override
  public void play() {
    System.out.println("Play Wav");
  }
}

class Mp3 implements playAlgorithm {
  @Override
  public void play() {
    System.out.println("Play Mp3");
  }
}

์œ„์™€ ๊ฐ™์ด ์žฌ์ƒํ•˜๊ณ ์ž ํ•˜๋Š” playAlgorithm ์ธํ„ฐํŽ˜์ด์Šค์˜ play() ๋ฅผ ์žฌ์ •์˜ ํ•˜๋„๋ก ์„ค๊ณ„ํ•œ๋‹ค.

์ด์™€ ๊ฐ™์€ ์„ค๊ณ„ ๋ฐฉ์‹์„ ๋””์ž์ธ ํŒจํ„ด์—์„œ๋Š” ์ „๋žต ํŒจํ„ด (Strategy Pattern) ์ด๋ผ๊ณ  ํ•œ๋‹ค.

OCP ๋ฅผ ๋งŒ์กฑํ•œ ์„ค๊ณ„๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์žฅ์ ์ด ์žˆ๋‹ค.

  • ๋ณ€๊ฒฝ์— ์œ ์—ฐํ•˜๊ฒŒ ๋Œ€์ฒ˜ ๊ฐ€๋Šฅํ•˜๋‹ค.
  • ์œ ์ง€๋ณด์ˆ˜ ๋น„์šฉ์ด ๊ฐ์†Œ๋œ๋‹ค.
  • ์ฝ”๋“œ์˜ ๊ฐ€๋…์„ฑ์ด ๋†’์•„์ง„๋‹ค.

๋ฆฌ์Šค์ฝ”ํ”„ ์น˜ํ™˜ ์›์น™ (LSP : Liskov Substitution Principle)

OCP (Open Close Principle : ๊ฐœ๋ฐฉ ํ์‡ ์˜ ๋ฒ•์น™) ๊ณผ ๋ฐ€์ ‘ํ•œ ์—ฐ๊ด€์ด ์žˆ์œผ๋ฉฐ OCP ๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ ๊ตฌํ˜„ํ•œ ํ…œํ”Œ๋ฆญ ์„ค๊ณ„์˜ ํ•˜๋‚˜์˜ ์˜ˆ๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค.
์ฆ‰ LSP ๋Š” OCP ์˜ ํ•ด๊ฒฐ์ฑ… ์ค‘ ํ•˜๋‚˜์ด๋‹ค.

์ •์˜

  • ์ž์‹ (ํŒŒ์ƒ) ํด๋ž˜์Šค๋Š” ์–ธ์ œ๋‚˜ ๋ถ€๋ชจ (๊ธฐ๋ฐ˜) ํƒ€์ž…๊ณผ ํ˜ธํ™˜์ด ๋˜์–ด์•ผ ํ•œ๋‹ค.
  • ์„œ๋ธŒํƒ€์ž…์€ ์–ธ์ œ๋‚˜ ๊ธฐ๋ฐ˜ ํƒ€์ž…๊ณผ ํ˜ธํ™˜๋  ์ˆ˜ ์žˆ์–ด์•ผ ํ•œ๋‹ค.
  • ํ•˜์œ„ ํด๋ž˜์Šค๊ฐ€ ์ƒ์œ„ ํด๋ž˜์Šค์˜ ์—ญํ• ์„ ๋Œ€์‹ ํ•  ๋•Œ ๋…ผ๋ฆฌ์ ์œผ๋กœ ๋งž์•„ ๋–จ์–ด์ ธ์•ผ ํ•œ๋‹ค.

๋‹ค์Œ ์˜ˆ๋Š” ์ด๋ฅผ ์„ค๋ช…ํ•˜๊ธฐ ์œ„ํ•œ ๊ฐ€์žฅ ์œ ๋ช…ํ•œ ์˜ˆ ์ด๋‹ค.

์ตœ์ดˆ์— ๊ธฐ๋ฐ˜ํƒ€์ž…์„ ๋‹ด๋‹นํ•  Rectagle ํด๋ž˜์Šค๋ฅผ ์„ ์–ธํ•œ๋‹ค.

์—ฌ๊ธฐ์—๋Š” ๋„ˆ๋น„์™€ ๋†’์ด ๋“ฑ์ด ์„ ์–ธ๋˜์–ด ์žˆ์œผ๋ฉฐ ๋„ํ˜•์˜ ๋„“์ด๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” area ํ•จ์ˆ˜๊นŒ์ง€ ๊ตฌํ˜„๋˜์–ด ์žˆ๋‹ค.

class Rectangle {
  private int width;
  private int height;

  public void setHeight(int height) {
    this.height = height;
  }

  public int getHeight() {
    return this.height;
  }

  public void setWidth(int width) {
    this.width = width;
  }

  public int getWidth() {
    return this.width;
  }

  public int area() {
    return this.width * this.height;
  }
}

Rectangle ํด๋ž˜์Šค๋ฅผ ์ƒ์† ๋ฐ›๋Š” Square ํด๋ž˜์Šค๊ฐ€ ์žˆ๋‹ค. Square ํด๋ž˜์Šค๋Š” ์ •์‚ฌ๊ฐํ˜• ์˜ ๋„ํ˜• ์ฒ˜๋ฆฌ๋ฅผ ๋‹ด๋‹นํ•˜๋Š” ํด๋ž˜์Šค์ด๋‹ค.

class Square extends Rectangle {
  @Override
  public void setHeight(int value) {
    this.width = value;
    this.height = value;
  }

  @Override
  public void setWidth(int value) {
    this.width = value;
    this.height = value;
  }
}

์œ„์˜ ๋‘๊ฐœ์˜ ํด๋ž˜์Šค๋ฅผ ์†Œ๋น„ํ•  ๋ฉ”์ธ ํ•จ์ˆ˜์ด๋‹ค.

public class MyClass {
  static boolean checkAreaSize(Rectangle r) {
    r.setWidth(5);
    r.setHeight(4);

    if (r.area() != 20 ) {
      throw new RuntimeException("Bad Area");
    }

    return true
  }

  public static void main(String[] args) {
    checkAreaSize(new Rectangle());
    checkAreaSize(new Square()); // Error Exception
  }
}

์ด๋ฅผ ์‹คํ–‰ํ•˜๋ฉด ๋‘๊ฐœ์˜ ํด๋ž˜์Šค๊ฐ€ ์ „ํ˜€ ๋‹ค๋ฅธ ๊ฒฐ๊ณผ๋ฅผ ๊ฐ€์ ธ์˜จ๋‹ค.

ํ•˜๋‚˜๋Š” Rectangle ํด๋ž˜์Šค๋Š” ๋„“์ด๊ฐ€ 20 ์œผ๋กœ ์—ฐ์‚ฐ ๋˜๋Š”๋ฐ ๋ฐ˜ํ•ด Square ํด๋ž˜์Šค๋Š” ์˜ค๋ฅ˜๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค.

์ด๊ฒƒ์ด ๋ฐ”๋กœ ๋ฆฌ์Šค์ฝ”ํ”„์˜ ์น˜ํ™˜ ์›์น™ ์„ ๋ฒ—์–ด๋‚œ ๋Œ€ํ‘œ์ ์ธ ์˜ˆ์ด๋‹ค.

๋‹ค์‹œ ์ •๋ฆฌํ•˜๋ฉด ์ƒ์œ„ ํƒ€์ž…์˜ ๊ฐ์ฒด๋ฅผ ํ•˜์œ„ํƒ€์ž…์˜ ๊ฐ์ฒด๋กœ ์น˜ํ™˜ํ•ด๋„ ์ƒ์œ„ ํƒ€์ž…์„ ์‚ฌ์šฉํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์€ ์ •์ƒ์ ์œผ๋กœ ๋™์ž‘ ํ•ด์•ผ ํ•œ๋‹ค.

๋ฆฌ์Šค์ฝ”ํ”„ ์น˜ํ™˜์„ ๋ฒ—์–ด๋‚˜๋Š” ์œ„๋ฐ˜์‚ฌ๋ก€๋Š” ๋Œ€ํ‘œ์ ์œผ๋กœ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

  1. ๋ช…์‹œ๋œ ๋ช…์„ธ์—์„œ ๋ฒ—์–ด๋‚œ ๊ฐ’ ์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค.
  2. ๋ช…์‹œ๋œ ๋ช…์„ธ์—์„œ ๋ฒ—์–ด๋‚œ ์˜ค๋ฅ˜ ๋ฅผ ๋ฐœ์ƒํ•œ๋‹ค.
  3. ๋ช…์‹œ๋œ ๋ช…์„ธ์—์„œ ๋ฒ—์–ด๋‚œ ๊ธฐ๋Šฅ ์„ ์ˆ˜ํ–‰ํ•œ๋‹ค.

ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

  • ์ƒ์†๊ด€๊ณ„๋ฅผ ์ œ๊ฑฐํ•œ๋‹ค.
  • ๋ฌธ์ œ๊ฐ€ ๋˜๋Š” area() ๋ฅผ Square ๋กœ ์ด๋™ํ•œ๋‹ค.
  • LSP ๋ฅผ ํ†ตํ•˜์—ฌ ์ž์‹ ํด๋ž˜์Šค๊ฐ€ ์ƒ์†๋ฐ›์€ ๋ถ€๋ชจ ํด๋ž˜์Šค์˜ ์—ญํ™œ์„ ์ถฉ์‹คํžˆ ํ•˜๋ฉด์„œ ํ™•์žฅ ํ•ด๋‚˜๊ฐ€์•ผ ํ•œ๋‹ค.

์ธํ„ฐํŽ˜์ด์Šค ๋ถ„๋ฆฌ ์›์น™ (ISP : Interface Segregation Principle)

์ตœ์†Œํ•œ์˜ ์˜๋ฏธ์— ๋งž๋Š” ์ธํ„ฐํŽ˜์ด์Šค๋งŒ ๊ตฌํ˜„ํ•ด์•ผ ํ•œ๋‹ค.

  • ํ•˜๋‚˜์˜ ํด๋ž˜์Šค๋Š” ์ž์‹ ์ด ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ์ธํ„ฐํŽ˜์ด์Šค๋Š” ๊ตฌํ˜„ํ•˜์ง€ ์•Š์•„์•ผ ํ•œ๋‹ค.
  • ํ•˜๋‚˜์˜ ์ธํ„ฐํŽ˜์ด์Šค๋ณด๋‹ค๋Š” ์—ฌ๋Ÿฌ๊ฐœ์˜ ๊ตฌ์ฒด์ ์ธ ์ธํ„ฐํŽ˜์ด์Šค๊ฐ€ ๋‚ซ๋‹ค

์‹œ์Šคํ…œ์˜ ๋‚ด๋ถ€ ์˜์กด์„ฑ์„ ์•ฝํ™”์‹œ์ผœ ๋ฆฌํŽ™ํ† ๋ง, ์ˆ˜์ •, ์žฌ๋ฐฐํฌ๋ฅผ ์‰ฝ๊ฒŒํ•  ์ˆ˜ ์žˆ๋‹ค.

์˜์กด ์—ญ์ „ ์›์น™ (DIP : Dependency Inversion Principle)

ํ•˜์œ„ ๋ ˆ๋ฒจ๋ชจ๋“ˆ์˜ ๋ณ€๊ฒฝ์ด ์ƒ์œ„ ๋ ˆ๋ฒจ ๋ชจ๋“ˆ์˜ ๋ณ€๊ฒฝ์„ ์š”๊ตฌํ•˜๋Š” ์—ญ์ „ํ˜„์ƒ

  • ์˜์กด ๊ด€๊ณ„๋ฅผ ๋งบ์„ ๋•Œ, ๋ณ€ํ™”ํ•˜๊ธฐ ์‰ฌ์šด๊ฒƒ (ํด๋ž˜์Šค) ๋ณด๋‹จ ๋ณ€ํ™”ํ•˜๊ธฐ ์–ด๋ ค์šด ๊ฒƒ (์ถ”์ƒํด๋ž˜์Šค, ์ธํ„ฐํŽ˜์ด์Šค) ์— ์˜์กดํ•ด์•ผ ํ•œ๋‹ค

DIP

Policy policy = new UrlPolicyImpl();

new Factory(policy);

์œ„์™€ ๊ฐ™์ด ๊ตฌ์ƒ ํด๋ž˜์Šค์— ์˜์กดํ•˜๋Š”๊ฑธ ์ถ”์ƒํด๋ž˜์Šค์— ์˜์กดํ•˜๋Š” ๊ฒƒ์ด๋‹ค.

UrlPolicyImpl ํด๋ž˜์Šค๋Š” Policy ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ๊ตฌํ˜„ํ•˜๋Š”๋ฐ new Factory(policy); ์™€ ๊ฐ™์ด ์‹ค์ œ๋กœ Policy ์ธํ„ฐํŽ˜์ด์Šค์—๊ฒŒ ์˜์กดํ•˜์—ฌ ์ดˆ๊ธฐํ™”๋ฅผ ํ•œ๋‹ค.

์ด๋Š” ๋ณ€ํ™”ํ•˜๊ธฐ ์‰ฌ์šด ์‹ค์ œ ๊ตฌํ˜„ ํด๋ž˜์Šค UrlPolicyImpl ๋ณด๋‹ค Policy ์ธํ„ฐํŽ˜์ด์Šค์—๊ฒŒ ์˜์กดํ•จ์œผ๋กœ์จ ์•ˆ์ •์ ์œผ๋กœ ๊ฐ€์ ธ๊ฐˆ ์ˆ˜ ์žˆ๋‹ค.