# Subtypes or parametric types to define constructor-dependent functions

**URL:** <https://discourse.julialang.org/t/subtypes-or-parametric-types-to-define-constructor-dependent-functions/26681>\
**Category:** General Usage\
**Tags:** type, parametric-types\
**Created:** [July 23, 2019, 12:41pm UTC](https://discourse.julialang.org/t/subtypes-or-parametric-types-to-define-constructor-dependent-functions/26681 "2019-07-23T12:41:04Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![DrChainsaw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/drchainsaw/32/8497_2.png) [@DrChainsaw](https://discourse.julialang.org/u/DrChainsaw)\
**Post date:** [July 25, 2019, 3:23pm UTC](https://discourse.julialang.org/t/subtypes-or-parametric-types-to-define-constructor-dependent-functions/26681/7 "2019-07-25T15:23:53Z")

</div>

> [@heliosdrm](#):
>
> Does it not contradict the premise of [avoiding fields with abstract types](https://docs.julialang.org/en/v1/manual/performance-tips/#Avoid-fields-with-abstract-type-1)?

Yes, I guess you are right not to trust the newbie here 🙂

This thread touches upon a similar topic (in case you haven’t seen it already):

> [@How to access shared "inherited" fields without paying multiple dispatch performance price?](https://discourse.julialang.org/t/how-to-access-shared-inherited-fields-without-paying-multiple-dispatch-performance-price/26762):
>
> Hi, I’m evaluating Julia to replace some old C++ code. The code uses inheritance where there is a single base class and lots (100’s) of derived classes. There are a large number of instances, and the code needs to be able to quickly get a base class field from a derived instance. I know that Julia does not have field inheritance and uses multiple dispatch to access data on abstract types instead. However, I’ve noticed that multiple dispatch methods slow down quite a bit for my use case when man…

---

_[View the full topic](https://discourse.julialang.org/t/subtypes-or-parametric-types-to-define-constructor-dependent-functions/26681)._
