[BlindSpot] Log 04. Let's follow the SOLID principles
dev.to·20h·
Discuss: DEV
🦀Rust Macros
Preview
Report Post

SOLID Principles

Last time, we learned about SRP, one of the SOLID principles, and refactored our code based on it. This time, we’ll refactor our code based on the DIP principle.

DIP(Dependency Inversion Principle)

DIP is the principle that higher-level modules should depend on abstractions (interfaces) rather than on the concrete implementations of lower-level modules. Failure to adhere to this principle can lead to increased dependencies between classes, such that modifying one class can lead to subsequent modifications to other classes affected by the change. Furthermore, if a test class lacks an interface, a new class must be created to perform the same functionality. In my code, there are currently a large number of Manager/Service objects that use the Singleton pat…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help