Best practices for implementing Calculated Fields?

65 views Asked by At

I would like to get some advise on the best practices regarding implementing calculated fields in the schema.

Typical e.g.:

Class ABC contains fields: Field1...Field10

Field1...Field5 are 'static' fields.
Field6 = some operation(Field1,Field2)
Field7 = some operation(Field3,Field6)
Field8 = some operation(Field1,Field5,Field6,Field7)

Now, every time a create/update operation is done on any/all of Field1...Field5, fields Field6...Field10 need to be updated, in order.

What is the best (most efficient) practice to achieve this?

Also, is there some way (or on the Parse roadmap) to implement Calculated fields in the Dashboard itself? And determine the formulas there itself, while defining a field?

^ This has become sort of the prevalent way of defining Calculated fields in most modern database/database abstraction tools.

Hard coding every formula to detect a field/fields change, while maintaining the correct order of updates for the calculated fields seems to be too gargantuan a task for modern times.

Any advise on this is most appreciated! Thanks.

0

There are 0 answers