0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Clean Architecture を読むときに必要なクラス図の読み方

Posted at

依存

依存先のオブジェクトの変更が、依存元オブジェクトに影響を与える可能性のある関係


class MathTextbook {
  public getContent() {
    return '数学の教科書'
  }
}
 

class ScienceTextbook {
  public getContent() {
    return '理科の教科書'
  }
  private privatePrintContent() {}
}


class Teacher {
 public publicTeach() {
   const mathTextbook = new MathTextbook()
   const scienceTextbook = new ScienceTextbook()
   console.log(mathTextbook.getContent())
   console.log(scienceTextbook.getContent())
 }
}

実装

interface を実装するクラスの関係


interface Textbook {
  getContent()
}

class MathTextbook implements {
  getContent() {
    console.log('数学の教科書')
  }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?