Skip to content Skip to sidebar Skip to footer

Best Association Approach To Connect Sensor Model To Others

I'm trying to implement the following with Flask+SQLAlchemy: I have two database models containing information about bee apiaries and bee hives. I would like to add feature to some

Solution 1:

After two days of experiments I have came to final conclusion. Examples have been taken from this source.

  • "Discriminator on association" (candidate for answer):

    • (+) has backward reference
    • (?) can have 1 parent object
    • (-) complexity
  • "Generic Foreign Key":

    • (+) low complexity
    • (+) has backward reference
    • (?) can have 1 parent object
    • (-) programmer's code must take care of cascading actions
  • "table per association":

    • (+) multiple parents
    • (+) shared table stays intact
    • (?) number of tables raises with number of associated tables
    • (-) no backward reference
  • "table per related" (candidate for answer):

    • (+) every associated object is in same table
    • (+) can have multiple tables
    • (-) associated objects are somehow separated for each foreign table

Answer: "Discriminator on association" as Sensor do not have ability of superposition and therefore no need for multiple parents.

Post a Comment for "Best Association Approach To Connect Sensor Model To Others"