# Best practices for type dispatch?

**URL:** <https://discourse.julialang.org/t/best-practices-for-type-dispatch/3174>\
**Category:** General Usage\
**Created:** [April 11, 2017, 5:12pm UTC](https://discourse.julialang.org/t/best-practices-for-type-dispatch/3174 "2017-04-11T17:12:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [April 11, 2017, 6:10pm UTC](https://discourse.julialang.org/t/best-practices-for-type-dispatch/3174/2 "2017-04-11T18:10:12Z")

</div>

Duplicate. Here’s my answer.

> [@Singleton types vs. instances as type parameters](https://discourse.julialang.org/t/singleton-types-vs-instances-as-type-parameters/2802/2):
>
> Oh yes, this question slight_smile. Fond memories. In JuliaDiffEq, we had a similar problem: what should solve(prob,alg) dispatch on, the type of alg or its instance? We had a month where we: Went with the type Went to the instance Went back to the type Finally at the instance. It has stayed with the instance ever sense. Example: solve(prob,RK4()) The reason is because this is much more flexible. It took me awhile to get here though! Arguments are given here: [https://github.com/Julia…](https://github.com/JuliaDiffEq/Sundials.jl/issues/97)

---

_[View the full topic](https://discourse.julialang.org/t/best-practices-for-type-dispatch/3174)._
