Change Unidirectional Association to Bidirectional
From CSSEMediaWiki
Revision as of 21:24, 14 October 2009 by Brett Ward (Talk | contribs)
If you have two classes that need to use each other's features, but the link currently goes one way, change the association to bidirectional to allow needed navigation.
This refactoring uses back pointers to implement the needed bidirectionality. This pointer will be added as a field. Decisions will also need to be made on which class controls the association, with the non-controlling side needing a helper method. The existing modifier will need to be altered or added to the controlling side to update the back pointers.
See Also: