First off, I want to wish everybody a Happy New Year. Hope your holidays were good.
I haven’t posted for a while and I thought it was time for an update. I’ve refactored all of my PHP code into classes so that it will be more object oriented. I created a test page to test every method of every class and got that working. Then I modified all of the pages to use the new classes, and to ensure that everything is properly separated, with the data in the PHP code and all formatting controlled by the Web pages. That is now completed and working n my test environment.
All my Ajax code is currently developed by me, but I’ve been looking at some open source libraries, mainly Knockout and jQuery. Knockout is for data binding so that I can define fields on the Web pages and bind them to JavaScript classes that hold the data. I already have a framework in place that does this, but I’m looking into whether it is worth the effort to move to this open source Knockout framework. The same goes for jQuery. I could use it to send Ajax requests to the server in place of the code I already use. If I do decide to switch, now would be the best time as I plan to revise my JavaScript object model to match my PHP and Java code.
Another issue I need to tackle is how to transfer the data from the PHP server code to the JavaScript client code. Currently I send an XML document with all the fields required by the user interface. I plan to divide this up into separate classes the same as my weather station software, as the classes are updated at different intervals. This would save on server round trips to pass data that I know hasn’t changed. I may also choose to use JSON to encode the data rather than XML. This will make things much easier on the client side.
I’ll continue working and post another update soon.