Good programming practices


Applet interaction with URL hash

March 15th, 2011

Applets don’t have to be just isolated box on a web page. They can communicate with a web page in which they are placed. Below is example of how can applet react to URL changes and also cause the changes.


  • Possibility to creates anchor which changes the state of an applet, for example selecting a tab in tabbed pane.
  • State changes are added to window history, so you can use back and forward buttons.
  • No need to reload applet nor web page.


Hybrid class with JavaScript and PHP

January 9th, 2011

JavaScript and PHP are very often used together in one project. In order to facilitate programming with these two languages I created a library that allows you to implement part of the class in JavaScript, and the rest in PHP. In this way, you can call a JavaScript method written in PHP. The developer can focus on creating code, and synchronization is done by the library.


Objects in JavaScript are client-side, allowing you to interact with the user. Logical layer remains on the server side.

  • Create and modify objects in the GUI, which are next written in PHP, for example in a database.
  • Validation of data entered by the user.
  • Hiding parts of the implementation from the user.
  • Use features not available in JavaScript. More…