Cache parent and child object for dependencies

fixes #6565