# Is this design pattern of \`::Val{}\` dispatching evil?

**URL:** https://discourse.julialang.org/t/is-this-design-pattern-of-val-dispatching-evil/54365
**Category:** General Usage
**Tags:** dispatch, design-pattern, val
**Created:** [February 1, 2021, 9:51am UTC](https://discourse.julialang.org/t/is-this-design-pattern-of-val-dispatching-evil/54365 "2021-02-01T09:51:19Z")
**Posts on this page:** 1
**Showing post:** 11

<div class="post-metadata">

### Author: ![Xuan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xuan/32/22100_2.png) [@Xuan](https://discourse.julialang.org/u/Xuan)
#### Post date: [February 25, 2022, 10:25pm UTC](https://discourse.julialang.org/t/is-this-design-pattern-of-val-dispatching-evil/54365/11 "2022-02-25T22:25:02Z")

</div>

In case this is still relevant, [I just wrote a small package called ValSplit.jl](https://discourse.julialang.org/t/ann-valsplit-jl-compile-away-dynamic-dispatch-on-val-typed-arguments/77096) that allows users to dispatch on `Val`-typed arguments without incurring the overhead of dynamic dispatch!

In contrast to using constant global dictionary, it’s both faster and more extensible. (Unlike a global dictionary though, it will prevent users from modifying what function a particular Symbol maps to, if the corresponding method is already defined in the base package.)

---

_[View the full topic](https://discourse.julialang.org/t/is-this-design-pattern-of-val-dispatching-evil/54365)._
