# \[APPROVED\] Polymorphic relations. When creating relation, ability to have many Types from which to choose, and not just one Type

**URL:** <https://community.fibery.io/t/approved-polymorphic-relations-when-creating-relation-ability-to-have-many-types-from-which-to-choose-and-not-just-one-type/425>\
**Category:** Ideas & Features\
**Tags:** flexible-domain\
**Created:** [November 22, 2019, 12:14am UTC](https://community.fibery.io/t/approved-polymorphic-relations-when-creating-relation-ability-to-have-many-types-from-which-to-choose-and-not-just-one-type/425 "2019-11-22T00:14:24Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [August 26, 2020, 8:52pm UTC](https://community.fibery.io/t/approved-polymorphic-relations-when-creating-relation-ability-to-have-many-types-from-which-to-choose-and-not-just-one-type/425/15 "2020-08-26T20:52:28Z")

</div>

Just for what it’s worth, there is a program I previously used for doing the stuff I’m now doing in fibery, and it used the concept of subtypes to achieve the result that @Oshyan is talking about  
That is to say, enabling/disabling field visibility. You could choose for each subtype which type fields were to be visible/accessible. When an entity was created, you had to choose a subtype.  
It was actually possible to change subtype subsequently, and a minor issue I discovered by experimenting was that, the contents of the fields/relationships that became hidden when you changed subtype were not actually affected, because it was only the visibility/editability that was enabled/disabled. This had some interesting consequences.

So in @Oshyan 's example, if I changed an entity from subtype ‘Company’ to subtype ‘Person’, the ‘employees’ field would still contain data, but just hidden, so a person would in effect take on employees(!)  
I know that example is kinda weird, because why would you change from company to person?!

In my case, I would use the subtypes to distinguish between manufactured parts that were sellable products (with a ‘Product code’ field, an ‘SKU’ field and a relationship to a ‘Label’ type) and parts that were only sub-assemblies for internal referencing. In this case, an item could move from one subtype to another. It could confuse people if, for example, a product became a sub-assembly and yet appeared to still have an ‘SKU’ and be linked to a ‘Label’.

Anyway, long story short, I think true polymorphism is a more elegant solution 🙂

---

_[View the full topic](https://community.fibery.io/t/approved-polymorphic-relations-when-creating-relation-ability-to-have-many-types-from-which-to-choose-and-not-just-one-type/425)._
