# Add type mixins to overcome subtype limitations

**URL:** https://discourse.julialang.org/t/add-type-mixins-to-overcome-subtype-limitations/816
**Category:** Internals & Design
**Created:** [December 8, 2016, 11:47pm UTC](https://discourse.julialang.org/t/add-type-mixins-to-overcome-subtype-limitations/816 "2016-12-08T23:47:46Z")
**Posts on this page:** 1
**Showing post:** 14

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [December 9, 2016, 4:37pm UTC](https://discourse.julialang.org/t/add-type-mixins-to-overcome-subtype-limitations/816/14 "2016-12-09T16:37:53Z")

</div>

It could also be helpful to have an abstract helper type for all types that have a noise field:

```julia
abstract MakesNoise

volume(x::MakesNoise) = x.noise.loud ? 20 : 10

make_some_noise(x::MakesNoise) = play(Sound(x.noise.sound), volume(x))

```

Then you could make `Dog <: MakesNoise` and `Cat <: MakesNoise` and “paint” noise-related method onto those types. The main limitation here is that types can’t inherit from multiple abstract types – which is a limitation we’ve been aware of [for some time](https://github.com/JuliaLang/julia/issues/5).

---

_[View the full topic](https://discourse.julialang.org/t/add-type-mixins-to-overcome-subtype-limitations/816)._
