I have a scenario where I'm using an external service which requires a big hash of parameters like so:
def external_service_params(user, invoice)
{
name: user.name,
email: user.email,
phone: user.phone,
invoice_id: invoice.id,
invoice_number: invoice.number,
invoice_total: invoice.total
}
end
Is this a case of either "feature envy" or "data envy"? If so, the solution is to move the method into the other object. But I feel uncomfortable with this because the set of data that is required only concerns the external service. If I kept doing that I feel like my other data objects would be bloated with many methods. Am I misinterpreting the smell or are there better solutions?