当前位置:网站首页>“is-a”,“has-a”,“like-a”

“is-a”,“has-a”,“like-a”

2022-06-11 16:44:00 Peach

1.“is-a” It's an inherited relationship , such as An equilateral triangle is a triangle , that , Triangle is the base class of equilateral triangle .
2.“has-a” It's an aggregated relationship ,, When A At the time of creation ,B Not necessarily create ; When A When they die ,B Not necessarily dead .
3.“like-a” It's a combinatorial relationship , When creating a A Object time , It will also create a B object ; When A When an object dies , As A Property of B Objects also die .


原网站

版权声明
本文为[Peach]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206111630047767.html