I've always been taught, as I guess most of you are, that calculated attributes should not be used in Mendix. There is supposed to be a performance hit for a couple of reasons:
- it will be calculated each time it is read instead of only once when it's written
- when retrieving records from the database where the entity has a calculated attribute, all attributes will always be retrieved instead of just the needed attributes
The most important advantage of ca's I think is simple:
- No need for complicated and error prone code to make sure the value is always kept up to date
What do you think? Should we still avoid ca's, or is it fine to use them. Should you using them only in specific cases? If so, Which?