April 28, 2004

Movies cubed

We just wrapped up one project at work and have a few days before the next official one begins. In the mean time, we're having a little fun. We're adding a new feature to the intranet called "Movies Cubed (m3)". It's a place where a fellow employee can post a list of DVDs he owns and then other people can request to borrow them. I chose this one because it would give me a change to play with the Amazon Web Service which i thought would be fun. I'm using the service to get pictures, release dates, ratings and the like.

I'm also taking this opportunity to try a new method of form processing. Every project we do nowadays involves getting data in and out of a SQL Server though some form of HTML form. I've tried many techniques over the years to accelerate the time it takes to produce this functionality with the least amount of work and yet still be reliable. My latest idea involves an XML file that describes all the data tables the web app will be interacting with which includes field definitions. Then, in the same file, i create a node to represent each HTML form and give it a child node for each input field on the form. These child nodes simply reference the table field definitions that they are mapped to. I've created a generic form builder object that will actually create all the appropriate input fields (based upon destination field data types) in either an "add" or "edit" mode. Also in this XML file i have nodes that represent the stored procedures that i ultimately use to update the database, with similar lists of the parameters it needs. With the help of a generic command object builder, one method will return an ADO command object with correctly defined parameters once again based on the underlying table definitions.

If this works, i can maintain all the HTML forms from a single file and have one place to change a data type (for the times when we decide a "title" field should be 75 characters rather than 50). I'm not sure i'm completely in love with this method yet, but its nice to have the chance to try something new with out worrying about deadlines.

Posted by Matthew at April 28, 2004 10:24 PM
Comments