how to read/write relation at class diagram

yongduk kim·2023년 12월 29일
0

relation

Association


class A association class B if class A has class B as class’s member varriable

inheritance


class A inheritance class B if A is child of class B

relization/implementation


class A relization interface B if A implement B’s all method

dependency


class A has dependency on class B if A has reference about class B in the field of parameter, local variable, method return type

aggregation


add concept of set to association, their’s no different in code but only concept is different

composition


concept is simmilar to aggregation but their are some difference like bellow

if A has compostion about B

  1. instance of A have responsibility about instance of B’s life cycle
  2. instance of B can’t be shared by other instance of A

first sentence mean like that

  • A instance have responsibility of B’s instance creation
  • if instance of A is deleted, instance of B also deleted
  • if instance of A is copied, instance of B also copied(not sharedm deep copy)


reference:

https://en.wikipedia.org/wiki/Class_diagram

https://brownbears.tistory.com/577

https://www.nextree.co.kr/p6753/

profile
기록과 함께하는 백엔드 개발

0개의 댓글