Circular dependencies in foreign keys: use it or avoid it?
问题 My application loads lots of data from a database into a complex data structure. The in-memory data structure ressembles the structure of the database, which means that if the database contains the following tables: table A, key is A1 table B, key is B1, one of the columns is a foreign key to [the key of] table A table C, key is C1, one of the columns is a foreign key to [the key of] table B Then I have classes A, B and C, and: a data member of B (B::m_a) is a pointer to A a data member of C