Composition and Parameters: Best Practice Suggestions

Hi All,
I am also trying to use manual composition and ros2 parameter feature with the demo example only.
I tried both ways.

  1. add parameter client to the node itself.

    rclcpp::SyncParametersClient::SharedPtr parameters_client = std::make_sharedrclcpp::SyncParametersClient(this);

With this approch, I get error as no matchin function as “rclcpp::SyncParametersClient::SyncParametersClient”. Because this is referrence to talker node which is of type composition.

2)add parameter client before adding to the executor:
auto talker = std::make_sharedcomposition::Talker();
auto parameter_client = std::make_sharedrclcpp::parameter_client::SyncParametersClient(talker);
exec.add_node(talker);
With this approach, not able to set parameters, as parameter_client is define here and set parameter action is getting done in talker_component.cpp.

I am testing this on crystal.
Thanks