Stimulus Discourse

One controller and multiple repeating target or multiple controller for each area?

I decided to write a little physical inventory calculator. Nothing fancy just that I have so many cases of an item (beer) and so many loose bottles ( or full liquor bottles and percent of open).

This is done in an html table with three fields that trigger a change action. It then does a calculation and sets a total.

I first tried a single controller for the table (60+ row) and got wrapped around trying to find the targets for that row. I then put the controller on each table row and have 60+ controllers but only single targets for the row. That became very simple with less that 10 lines of code to do the calculations (different between beer and liquor)

I was just wondering if having 60+ controller is consuming to many resources, I could go back to a single controller and recalculate all rows with any change, but that also seems to be a resource consumer in that its going to come up with the same answer except for the row that changed.

Just asking for an opinion.

2 Likes