Monday, May 29, 2006

Control Panel

Work on the control panel is continuing. At the moment, I'm working on making the user interface function. It's a bit of a chore as I'm dealing with four languages in order to design this portion -- SQL to store everything persistently, PHP for the server code, HTML for display, and javascript to enable client side interactivity. (There's actually five languages if you count CSS, but I only have to make changes there when my work threatens to break something the designer has already implemented.)

So what are the secrets to staying sane? Two good programming practices: compartmentalization and reuse of existing libraries. The main portion of my application is in charge of routing data between the database and the HTML forms. However, it doesn't know about either SQL or HTML. It understands the data that I am dealing with and takes care of getting it, transforming it into something the other objects can use, and sending it on to them. A database object takes care of taking the data as php variables and transforming it into SQL to query the database with. Similarly, I've stolen some ideas from Python's Quixote web framework to implement inheritable classes for the control panel's pages and modules. This allows me to put my display information into separate classes that follow their own logical rules. All the HTML is in templates within these classes. Minimal php is required to position the data the main application passes over into the templates.

All of this is standard practice (both for me and larger software projects in general.) Where I started exploring something new was when I added javascript into the mix.

Stay tuned for: Making Javascript Suck Less!

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home