# How do model a sub type that can fall under two different abstract types?

**URL:** <https://discourse.julialang.org/t/how-do-model-a-sub-type-that-can-fall-under-two-different-abstract-types/59355>\
**Category:** General Usage\
**Created:** [April 15, 2021, 4:16pm UTC](https://discourse.julialang.org/t/how-do-model-a-sub-type-that-can-fall-under-two-different-abstract-types/59355 "2021-04-15T16:16:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Raf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raf/32/3383_2.png) [@Raf](https://discourse.julialang.org/u/Raf)\
**Post date:** [April 15, 2021, 4:26pm UTC](https://discourse.julialang.org/t/how-do-model-a-sub-type-that-can-fall-under-two-different-abstract-types/59355/2 "2021-04-15T16:26:52Z")

</div>

Just answered this in another thread: [Why use subtypes instead of traits and duck typing? - #31 by Raf](https://discourse.julialang.org/t/why-use-subtypes-instead-of-traits-and-duck-typing/59146/31)

You can do a kind of multiple inheritance with subtyped traits. Edit: But this is probably overcomplicating things normal traits are all you need here.

You could also use regular object composition and multiple dispatch.

---

_[View the full topic](https://discourse.julialang.org/t/how-do-model-a-sub-type-that-can-fall-under-two-different-abstract-types/59355)._
