Are circular dependencies considered bad design?

后端 未结 2 894
不知归路
不知归路 2020-12-17 01:23

In my work (which is 90% Java but I\'m sure this question applies to other languages) I often create two classes that \"know about\" each other. More concretely, class A im

2条回答
  •  一生所求
    2020-12-17 02:15

    Yes , It's bad design , It's contradicting the oop principles , It's seems you have to create a new class or interface will contain the the shared parameters and function for a and b , a and b imports this new class...

提交回复
热议问题