当前位置:网站首页>software design principles
software design principles
2022-08-08 22:02:00 【Code_LT】
SOLID
- Single Responsibility Principle
- A class with only the first single responsibility
- Open-Closed Principle
- For extension development, closed for modification.Module design considerations: Implement changes to the module's behavior without modifying the source code.
- Liskov Substitution Principle
- Subclass design should ensure that subclasses can appear wherever the base class appears
- Interface Isolation Principle
- Classes shouldn't be forced to depend on methods they don't use, that is, an interface should have as little behavior as possible, is it lean, and is monolithic?
- Dependency Inversion Principle
- High modules do not depend on low modules, they all depend on abstraction.Abstraction does not depend on details, details depend on abstraction?
switch statement
If it is an object-oriented language, consider using polymorphism instead.
If it is a procedurally oriented language, consider refactoring with table-driven or strategy patterns.
边栏推荐
猜你喜欢
随机推荐
Invalid keystore format报错问题解决
TS入门基础
Redis之集群部署、哨兵集群
3分钟写个VBA:Excel工作簿所有子表数据一键汇总
九大内置对象四大域
Contextual Transformer Networks for Visual Recognition paper and code analysis
中国石油大学(北京)-《 完井工程》第一阶段在线作业
联合国前副秘书长点赞零数云南落地项目
依赖注入的正确打开方式 bilibili/kratos × google/wire
求无向简单图的割点与割线的问题(邻接矩阵)
第八章 继承
为什么要做LiveVideoStack课程?
九大内置对象,四大作用域
Mysql汉字乱码的问题
mysql 忘记root密码后 ERROR 1054 (42S22): Unknown column 'Password' in 'field list'
What can a reverse proxy server do?
峰会•沙龙•招聘 | 记零数科技多线并进的一天
用固态U盘让你的办公环境随身移动
ZERO Technology "Chain on the South"——deeply cultivated in the field of digital finance
差分约束