use component method to build all method about getParent and getChild