Tuesday, December 11, 2012

Web Application Code Execution Order Change

We made an important change in Real Studio 2012r2 with regards to code execution order. Until now, commands sent to a browser were queued in such a way that it was possible for property assignments to get out of order with other commands if you were not careful. While this internal queuing process worked for our internal framework (we were able to control the process with our own controls), with the advent of the Web Controls SDK, we had to switch to something that makes a little more sense to the average user.

For example, if your code looked something like this:

  MoviePlayer1.DesktopURL = "DesktopMovie.mp4"
  MoviePlayer1.MobileWifiURL = "WifiMovie.mp4"
  MoviePlayer1.Play()

It was possible for the code to be sent to the browser like this:

  MoviePlayer1.Play()
  MoviePlayer1.DesktopURL = "DesktopMovie.mp4"
  MoviePlayer1.MobileWifiURL = "WifiMovie.mp4"

In this case it was possible that the previous movie would start playing and then a new one would load because the properties were set second. Our controls were designed to handle this internally, but it made for some very hard to find bugs. 

As mentioned above, starting in 2012r2, property assignments and method calls are sent to the browser in the order they are specified in your code. We suspect that this will clear up a number of strange bugs that have been reported about properties not getting set properly.

2 comments:

olivier said...

Indeed, it is an important correction!

Anic297 said...

Thanks for the fix! I had problems exactly like the one mentioned (with movie players playing the previously-assigned movie before changing the movie).