当前位置:网站首页>OOP 7 design principles
OOP 7 design principles
2022-04-22 06:15:00 【For that peace】
Principle of single responsibility : Control the granularity of the class 、 Decouple objects 、 Improve its cohesion .
Opening and closing principle : Open to expansion , Turn off for changes .
Richter's principle of substitution : Inheritance must ensure that the properties owned by the superclass are still valid in the subclass .
The principle of Dependence Inversion : Interface oriented programming , Don't program for implementation .
Interface isolation principle : To establish them for each class, they need a dedicated interface .
Dimitar's law : Only talk directly to your friends , Don't talk to strangers .
Synthetic multiplexing principle : Try to use association relations such as composition or aggregation to achieve , Second, consider using inheritance relationship to achieve
版权声明
本文为[For that peace]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220545592638.html
边栏推荐
猜你喜欢
随机推荐
laravel数据库
JS调试干扰 - 无限debugger 绕过
Re transfer form to JSON
软考备考通关经验心得
Failed to execute ‘insertBefore‘ on ‘Node‘: The node before which the new node is to ... report errors
Halcon and opencv or Halcon configuration modify the inheritance value of the included directory and Library Directory
Flash [get / post] data processing
pip freeze 导出含有路径 (@ file:///) 问题小记
形参、局部变量以及局部静态变量
Difflib compares two files
Print various types of variables in PHP log
From simple to deep: learning journey of Xiaobai reptile (1)
重新回来了
laravel路由作业
laravel用模板继承实现圣杯模型
快应用模糊搜索
【无标题】点击分类 跳转页面 展示详细信息
关于常量指针、指针常量的使用--练习题(记录)
FastApi(三)
Back again









