Obviously, with a few methods, you will need to have some kind of abstract super-method that they would call, otherwise you would repeat yourself, which is considered bad, but sometimes itβs good to have methods like aliases or abbreviations (see, for example, jQuery $.getJSON()
for modified $.ajax()
-Call)
One method with a large number of parameters is not very flexible if you have many special or optional parameters, for which you would use the options object, as you mentioned in your third example.
It really comes down to the use case and the necessary flexibility / reuse. Personally, I've always been with the One method, with a parameter parameter.
source share