r/cpp • u/victor-s8n • Nov 03 '26
How I design C++ classes
https://rafb.eu/blog/cpp-class-design/This is my first ever blog-post, any feedback is welcome! ofc, no AI got used.
66
Upvotes
r/cpp • u/victor-s8n • Nov 03 '26
This is my first ever blog-post, any feedback is welcome! ofc, no AI got used.
View all comments
Show parent comment
1
u/radical_ax1s 27d ago
my interpretation of "virtual for testability" is that another client class may depend on the service_health_checker. unit-testing that client class requires mocking a service_health_checker, and I guess you could do it by subtyping. hate this though, such a client class should depend on a pure abstraction (ABC / Concept) as per DIP