jeudi 1 avril 2021

which design pattern allows me to implement two different classes, each class has a list of objects of the other class?

I have a class A and class B, class A has a list of instances of class B and class B has a list of instances of class A, in sql language, this is many to many relationship, is there a design pattern that helps in the implementation of these classes or am I overthinking it and it is just as simple as just assigning a respective list for each class?

Thanks

Aucun commentaire:

Enregistrer un commentaire