ashishps1 / awesome-low-level-design

Learn Low Level Design (LLD) and prepare for interviews using free resources.
https://blog.algomaster.io
GNU General Public License v3.0
5.46k stars 1.44k forks source link

Incorrect use or defintion of publish() method in PubSubSystem class #14

Closed shubug closed 1 month ago

shubug commented 1 month ago

Context: pubsubsystem

publish() method of PubSubSystem class is not getting used anywhere. From PubSubDemo file, we can see Publishers are directly calling the publish method of Topic, bypassing the PubSubSystem layer.

The entire implementation of PubSubSystem class has no mention of Publisher class, and directly dealing with Topic class and it's methods. This seems to break the OOPs concept.

ashishps1 commented 1 month ago

Hey, thanks for pointing out. PubSubSystem class was actually redundant so I have removed it.

Let me know if you see any other concern.