SOLID (object-oriented design)

In computer programming, SOLID (single responsibility, open-closed, Liskov substitution, interface segregation and dependency inversion) is a mnemonic acronym introduced by Michael Feathers for the “first five principles” named by Robert C. Martin[1][2] in the early 2000s[3] that stands for five basic principles of object-oriented programming and design. The intention is that these principles, when applied together, will make it more likely that a programmer will create a system that is easy to maintain and extend over time.[3] The principles of SOLID are guidelines that can be applied while working on software to remove code smells by providing a framework through which the programmer may refactor the software’s source code until it is both legible and extensible. It is part of an overall strategy of agile and Adaptive Software Development.[3]

InitialStands forConcept
SSRP[4]Single responsibility principle a class should have only a single responsibility (i.e. only one potential change in the software’s specification should be able to affect the specification of the class)
OOCP[5]Open/closed principle “software entities … should be open for extension, but closed for modification.”
LLSP[6]Liskov substitution principle “objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.” See also design by contract.
IISP[7]Interface segregation principle “many client-specific interfaces are better than one general-purpose interface.”[8]
DDIP[9]Dependency inversion principle one should “depend upon abstractions, [not] concretions.”[8]

https://en.wikipedia.org/wiki/SOLID_%28object-oriented_design%29

YAGNI:
https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值