> For the complete documentation index, see [llms.txt](https://hanfak.gitbook.io/workspace/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hanfak.gitbook.io/workspace/general-paradigms/patterns/api/convience-methods.md).

# convience-methods

* Generally, created to allow for mulitple inputs, or different types for an input
* Use overloading judiciously and sparingly
  * best to refrain from overloading methods with same number of params
  * avoid situations where the same set of parameters can be passed to different overloadings by the addition of casts
  * ensure that all overloadings behave identically when passed the same parameters
  * Have consistent argument order
  * Avoid long list of args, esp with same type
    * encapsulate in an object
* For constructors
  * use static factory methods
    * can return differetn subclasses in these methods
    * add validation, without polluting the constructor
    * avoid overloading the constructor
