Programmer's Log

Saturday, September 09, 2006


Backlash



The past few days, I have been struggling with new odds display and reducing the bandwidth problems with my own code. Couple months ago, I implemented our Member website with only one purpose in mind "make it better than the ASP version, as much as possible". I did succeed, our ASP.NET version is better, faster, going back to the database much less on betting procedure. However, I want to improve it and face so many obstacles; they drive me to the point to reimplement everything. The inexperience in designing and coding now show its true shadow.


In order to improve the bandwidth, I must detect all possible odds changes.

  • In the ASP versions, store procedure returns all the bet type by rows, each odds will be on one row, detecting odds changes will be on one row only which is the odds change time

  • In ASP.NET version, for my convenience of coding, I requested to put all the odds type of a match in one rows in the record sets. Bettype 1,3,7,8 will be on 1 rows with 4 different change times. To detect odds changes, I will have to check all 4 values. It gains in performance because the cost of moving down a row in the dataset more than we check for 4 values. But the source code will be definitely more complicated.



After detecting all odds changes, I must send out all these changes into a compact form; then populate the those datas into correct odds position which will be identified by the odds id. Everything sounds to be easy. ..BUT.. things are not easy as it should be; I will have to deal with my improvement of bet engine which I used to be proud of.

  • In ASP version, each odds is just a link. Once the user click on the link, they will go to the database to get all the information about the choice that they want to bet; one more trip to the database to create the bet slip.

  • My improvement in ASP.NET version was to store all the possible information when I built the display into something called Javascript "betstring". This "betstring" contained all the necessary information about the choice of the users. There is no need to go back to the database to collect all the information any more.



Because of building the bet slip by "betstring", I need all the information about that user choice including the team names, league names and score. Those information usually contains most of the data sent to browser. If I continue to include these information into refresh data, then I won't save much the bandwidth. Previous improvement now has impacts

Everything has a way to solve except my code will look UGLY.

0 Comments:

Post a Comment

<< Home