Model-Controller cyclic reference/design problem

Posted by jasamer on Stack Overflow See other posts from Stack Overflow or by jasamer
Published on 2010-06-11T02:14:07Z Indexed on 2010/06/11 2:23 UTC
Read the original article Hit count: 350

Filed under:
|
|

I have a CoreData entity X, and controllers for this entity, XController. Now there's another entity, XGroup, containing a collection of X entities, and a XGroupController.

Now the problem is that XGroupController needs to interact with XController, and it would be nice to just pass XGroupController a XGroup to observe, and then get the XControllers from the X entities.

So the question is: is it a good idea to store a (weak, to avoid retain cycles) reference to a controller in an entity? It just feels a bit "wrong". Is there another design pattern for this?

© Stack Overflow or respective owner

Related posts about core-data

Related posts about cyclic-reference