UML

  • 统一建模语言 Unified Modeling Language
  • 软件设计的绘图标准
  • 不仅仅是类图,还有很多其他

    画图工具

  • MS Visio

  • https://www.processon.com

类图

  • 三个区域:名称,属性,方法
  • 权限描述:+ (public) , # (protected) , - (private)

image.png

  1. class People {
  2. name: string
  3. age: number
  4. protected weight: number = 100
  5. private girlFriend: string = 'xxx'
  6. constructor(name: string, age: number) {
  7. this.name = name;
  8. this.age = age;
  9. }
  10. eat () {}
  11. speak (n: string) {
  12. console.log(n, this.girlFriend)
  13. return 100;
  14. }
  15. }

截屏2022-06-24 01.10.20.png