For derived stats, it's not enough to just always recalculate its value from scratch every time you access it. At least in my game, I also want to tell the user when the value of a derived stat changes. If you equip a piece of armor that raises your strength, I want the game to tell you "You feel stronger!".
So each derived stat stores its current value and then has a refresh() function to recalculate itself. The stat is refreshed at the end of each turn. It recalculates the value and then compares its previously cached one. If the value changed, it logs the result and then updates the cache.
[1]: https://github.com/munificent/hauberk
[2]: https://github.com/munificent/hauberk/blob/master/lib/src/en...
Worth every penny.
getStr() { output = this.str;foreach (equip) output += equip.getStrMod() }