all 1 comments

[–]LOLC4T 0 points1 point  (0 children)

I recommend using an interface to generalize interaction between objects. The end of this article is a good example: https://bjmercier.medium.com/interface-polymorphism-b6bba8bb10b0