My latest project that I worked on at ESPN was the NBA Trade Machine. This was a fun application to build. Our NBA Engineer Sachin spent a lot of time reading through the NBA collective bargaining agreement, and learning about all the rules about trading players in the NBA. He set up all the formulas and database tables that I used. I built the front end UI for this application. I tried to incorporate some Ajax techniques into this application to make the interface as usable as possible. You can pick up to four teams. After you select a team the application uses Ajax to get the players for that team to display. If a player has a trade restriction that prevents them from currently being traded, the checkbox is set to disabled. Depending on how many teams you have selected I used DHTML to display the team that the player is being sent to after you check a player. If more than two teams are in a trade, a select box is display with a choice of destination teams.
I also used Ajax to display individual player’s trade restrictions. With Ajax it is important to give the user a visual clue that something is happening on the page since the page doesn’t reload. I made a message of “Loading Teams” or “Loading Trade Restrictions” while the Ajax request is completing. One of the most challengin aspects of this application was dealing with the back button since that is an issue with Ajax applications. I ended up puting in as link that passes the trade parameters back to the page and then use JavaScript to fill to make the Ajax calles and fill in the form to the state it was in when the trade was submitted.
Overall the feedback for the application has been pretty positive, and I am still planning to make incremental improvements to the application. As part of this project I also built the administration tools to maintain the player contract and team payroll data. I used a lot of Ajax techniques for those tools as well.
