Reputation: 783
I am working with two different protocols that are wrapped into one class which the system calls. The wrapper calls the appropriate protocol based on the provided protocol type. Protocol A and B have about 90% common functions but there are several important functions that are exclusive to each protocol. Currently I am handling the protocol-specific functions by them public and using friend classes.
This seems to do the trick but I feel like there must be a way to handle these types of issues in a better way. I am self-taught so I lack knowledge in these areas. What are design patterns to handle these types of issues?
Upvotes: 0
Views: 131
Reputation: 763
Upvotes: 2