In my work (this is 90% Java, but I'm sure this question applies to other languages). I often create two classes that "know about each other." More specifically, class A imports B, and class B imports class A, and both have member or local variables of a different type.
Is this a bad design? Anti-pattern if you want?
Here is my trick:
Yes, this is a bad design, This is against the principles of oop. It seems you need to create a new class or interface that will contain common parameters and functions for a and b, a and b, import this new class ...
Source: https://habr.com/ru/post/907830/More articles:NDC + Protocol Documentation (NCR Direct Connection)? - financialUse UIImagePickerController on iphone simulator - iosiPhone No saved photo album created on iPhone - iphoneSecurity Security Trimming SQL Queries - c #Why doesn't the 'insert' function add rows using MySQLdb? - pythonScala DSL: a chain of methods with parameterless methods - scalaHow to use XQuery in C # - c #epub file error in object c - iphoneShowing and hiding UITableViewCell with quick UISwitch crash - iosEfficient temporary implementation of generating a probability tree and then sorting the results - javaAll Articles