Web Application Gallery Sample Application

I’m working on a PHP sample application for the Web Application Gallery.  The purpose of the application is to illustrate what is required to take a PHP application and create an installation package suitable for the Gallery. 

The application package needs to illustrate the following:

  1. How does the application get installed into IIS?
  2. How do you set up a database and connection?
  3. How do you set ACLs and which ACLs are appropriate for files and directories.

It sounds simple.  All you need is an application that talks to a database, and does something with local files.  Once you dive into it, the problem becomes more complex.  The biggest problem is that it’s actually difficult to completely avoid the use of best practices to get something out there quicker.  While there are some (many) shortcuts that can be taken, there are certain things that if you do them too quickly will make the code unreadable, or unusable for its primary purpose. 

The ability to get data out of a database isn’t what’s important.  The important thing is illustrating how you would use the Web PI to set up an application to use the database.  That means that the database credentials can’t be hardcoded.  The connection string needs to be someplace that’s easy to parameterize.  The defaults in the file have to be recognizable to the parameterization, and to the application to make sure that the parameterization has succeeded.

Which brings us to the topic of error detection and handling.  I could choose to put try/catch blocks around every piece of code where an error might occur.   I could create a generic error handler.  I could use a complex logging infrastructure.  Error detection and handling is not a simple concept.  Does it even belong in a sample application like this?

The app is going through code review right now.  It will be interesting to see what needs to be added in for the app to be suitable for distribution as part of the Web Application Gallery SDK.

 

No Comments