Object-oriented and domain-driven-design using custom data types.

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

Parents
  • 0
    Certified Senior Developer

    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!

    Kind regards,
    Roel

Reply
  • 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!

    Kind regards,
    Roel

Children