# Structure inheritance

**URL:** https://discourse.julialang.org/t/structure-inheritance/118699
**Category:** General Usage
**Tags:** question
**Created:** [August 28, 2024, 10:30am UTC](https://discourse.julialang.org/t/structure-inheritance/118699 "2024-08-28T10:30:17Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [August 28, 2024, 11:38am UTC](https://discourse.julialang.org/t/structure-inheritance/118699/3 "2024-08-28T11:38:01Z")

</div>

> [@mesonepigreco](#):
>
> Fermion \<: AbstractQuantumParticle, which also has a spin variable, but that also works with all the methods that interface with QuantumParticle via the multiple dispatch (plus some specific dispatching for it)

Sure, you can do this, but the exact implementation depends on _what the API is for `QuantumParticle`._

Eg if you expose `get_position` and `get_momentum`, you can just implement these methods to forward the value from the relevant field for `Fermion`. If you want the `Base.getproperty` to work (`.position`), you need a different approach, but it is doable.

Please provide specific and then you may get a more detailed answer.

(Also, please [quote your code](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530).)

---

_[View the full topic](https://discourse.julialang.org/t/structure-inheritance/118699)._
