2023年9月30日 星期六

SOLID programming rule

非禮勿動 / 透過被允許的介面操作機器 (方向盤/油門 rather than 噴油參數 w/ 檔位 ignored)
Polymorphism/Callback: function pointer --> 舊瓶裝新酒
Method vs data

SOLID refers to
S: Single Responsibility Principle
A code snippet of same logic is implemented more than once, make it a standalone function.
O: Open Close Principle
L: Liskov Substitution Principle
I: Interface Segregation Principle
D:*Dependency Inversion Principle

沒有留言: