Ask Your Question
1

Does using ddbDocClient directly from the utility have the same effect as passing it down to the utility through the parameters from the handler?

asked 2022-01-08 11:00:00 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-10-11 00:00:00 +0000

huitzilopochtli gravatar image

Yes, using ddbDocClient directly from the utility function or passing it down through the parameters from the handler will have the same effect as both ways will involve using the same instance of ddbDocClient to interact with the DynamoDB table. However, passing it down as a parameter may be considered a better practice as it clearly shows the dependencies of the utility function and makes it more modular and reusable.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-01-08 11:00:00 +0000

Seen: 10 times

Last updated: Oct 11 '22