This content has been marked as final. Show 4 replies
I can think of several solutions. 1) Use AIR which I presume does not have this limit. 2) Use a server to do the heavy lifting. 3) Do the work in pieces.
While I agree it is frustrating to have such time limits restrict the approach used, most web front-end technology has this type of limit to prevent run-away code from locking up the browser/user application.
I do not think that Flex was intended to be 100% of the application, but the front end to a client/server system where the bulk of the business logic was on the server. It turns out that flex is very usable for more than that, and that is what AIR is aimed at.
The problem that I'm in front of is as follows.
~500 rows of data. Each row is a calculated sum based on multiplying a value in one row of another ~500x500 table with another value and adding it to the running total.
I can do this in PhP on the server and it takes about two min' to run. The problem is that the user needs to be able to update a value, that value effects every other value in the table. So to resubmit this calculation back to the server is very time consuming and has the potential to overload the servers hardware.
It may just be my frustration at the task before me, but running into these timeout limits is like smacking into a brick wall at 100mph. I've not looked at AIR and shall do so, but there's no way I can come up with to break up the task into smaller chunks since every value is dependent on every other one. And even if I got it to work, I would have to work out minimum requirements for the web app due to hardware performance differences.
Try looking at it this way: If you exceed the time out the user is long past frustrated any way.
For the kind of problem you have you can not do this brute force by recomputing the entire matrix every time. You need to compute intermediate values that are not going to change just because the user changed one value. You can then compute the impact of the user change in a much more incremental manner. And if necessary factor that change back into the source data. As long as you do not need to spit out the full data set in XML for the user's change this should be quite doable with some careful planning on how to stage the data computation and the change propagation. This is how every spreadsheet works. You have an underlying network of relationships that propagate changes and only recompute what you have to recompute.
If you want to be more detailed feel free to contact me off-line firstname.lastname@example.org.
Well, the user in question is used to doing these massive calculations in Excel, they're used to getting a cup of coffee after making a change.
I have a working solution, even if it is a bit problematic. I'm doing the massive looping calculations in PhP and the per row calculations in Flex. It does mean that changes have to be sent back to the server and then recalculated, but such is life I suppose.