3 ms·
You seem to assume that the passed-in object should also be used as the resulting object. This is false, as they can be decoupled. In other words, it's still p
by sharpercoder 8y ago
You seem to assume that the passed-in object should also be used as the resulting object. This is false, as they can be decoupled.
In other words, it's still possible to pass in a separate js object instance containing the configuration.
Yet I'm not sure about the whole of your arguments, so I can't tell if it would actually make sense to wrap the default js builder pattern implementation (the javascript object initializer syntax aaaaaaaaaaab refers to).
However, I do method builders often overused in API's where a simple singular builder method combined with builder classes suffice and simplify.
- afandian 8y agoAgreed to an extent. But what if you want to extend the API to include the same field twice (for example). The semantics of the input object would prevent that. I'm reluctant to spend too much time arguing over a fine point. It could be done one way or the other. I was just addressing aaaaaaaaaaab's question.