Polymorphic Relationships


#1

Does DSP have support for polymorphic relationships?

A quick and dirty example would be something like having Tasks being grouped into a containing Package. These Packages can contain references to one or more Tasks or references to other Packages. This creates a potential hierarchy of

Package #1
 |
 |----Package #2
 |    |
 |    |----Task #1
 |    |----Task #2
 |    |----Task #3
 |
 |----Package #3
 |    |
 |    |----Task #4
 |    |----Task #5
 |    |----Task #6

In this example if you were working on Package #1 you would perform all of the tasks in Package #2 and Package #3. But if you were working on Package #2 you would just perform the tasks for Package #2.

Ideally all of these relationships would be stored in a single PackageCalledOns table


#2

Hey - apologies for the delayed response here. The way I would approach this would be to call a stored procedure. This was just added in our newest release. Looks like you’re using a mssql server… How much experience do you have with stored procs?


#3

@Mark no worries on the delayed response. I have a solid backgroun with sprocs however I’m using a data persistence layer (Ember-Data) and have yet to come up with a consistent way to call stored procedures using it. My thoughts are something along the lines of combining the request type with the model name and that combination being the name of the procedure. So a GET for Orders would call a proc of GetOrders. I don’t like the idea of forcing a schema on folks though so I’m still working through it. Thanks for the response!