Well, that might be a weird question, and maybe I'm heading the wrong direction, but here is my problem:
I have a SearchForm object that contains a collection of Tag objects. When a tag object is clicked by a user, it selects itself and fires an event. The SearchForm class listens for this event and represents itself. The Tag object is not related to SearchForm.
So far so good.
Now some tags should activate other tags when clicked. Each tag knows which other tags it must activate. But for this, he must KNOW about the entire collection of tags stored in the search form.
Would it be “bad” if the tag instance (= collection element) has a link to a complete list of all other tags (= collection)?
Of course, something like this would be doable:
Tag is clicked -> SearchForm is notified -> checks if the clicked tag must activate some others -> SearchForm activates the needed Tags itself.
But does this seem a little uncomfortable, or not?
source
share