# Generate a (mutable) struct which inherits others

**URL:** <https://discourse.julialang.org/t/generate-a-mutable-struct-which-inherits-others/47347>\
**Category:** New to Julia\
**Tags:** inheritance, struct\
**Created:** [September 27, 2020, 2:59am UTC](https://discourse.julialang.org/t/generate-a-mutable-struct-which-inherits-others/47347 "2020-09-27T02:59:15Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![marius311](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marius311/32/3953_2.png) [@marius311](https://discourse.julialang.org/u/marius311)\
**Post date:** [September 27, 2020, 3:54am UTC](https://discourse.julialang.org/t/generate-a-mutable-struct-which-inherits-others/47347/8 "2020-09-27T03:54:30Z")

</div>

You might find this discussion useful if you haven’t already seen it: [Composition and inheritance: the Julian way](https://discourse.julialang.org/t/composition-and-inheritance-the-julian-way/11231)

This package [https://github.com/rjplevin/Classes.jl](https://github.com/rjplevin/Classes.jl) can help emulate something like what you’re asking for, but I would keep in mind that this is not usually the right way to do things in Julia. Using abstract types and method dispatch would be the recommended solution that leads to clearer / faster / more “Julian” code.

---

_[View the full topic](https://discourse.julialang.org/t/generate-a-mutable-struct-which-inherits-others/47347)._
