We are currently performing maintenance on Appian Community. As a result, discussions posts and replies are temporarily unavailable. We appreciate your patience.
Hello,
Given this small domain model excerpt, how could I represent / create this using Appian custom data types? More specifically concerning the class inheritance of Product, Treatment and Implant.
When using an object-oriented language like C# I would typically employ a TPH, TPT or TPC table inheritance strategy in combination with an ORM framework to solve this.
Kind regards,Roel
Discussion posts and replies are publicly visible
So, if I understand this correctly, in my humble opinion, this can be done by referencing the "product" CDT as a field inside each of the "Treatment" and "Implant" tables with no problem.
Hi Ahmad,
Thank you for your reply!
I suppose I need to wrap my mind around the fact that there is no such thing as "CDT inheritance" like in object-oriented programming languages. So I did as you prescribed above and that indeed could possibly work. I would want however that the productId foreign key in the treatment table also at the same time becomes the primary key.
Can I achieve this by nesting the product CDT in the treatment CDT or should I only specify a productId field as primary key and specifiy the joins in a query? How can I be sure that the foreign key will be properly indexed in the underlying database to ensure performant joins/queries?
Product CDT
Treatment CDT
Treatment Table in SQL Server
Thanks in advance for your help!
Data design in Appian is pretty simple most of the time. There is some guidance available
https://docs.appian.com/suite/help/20.4/cdt_design_guidance.html