The requirement came about because I was asked if I could display booking availability on www.trentinney.co.uk - in addition they wanted to show availability for a number of other sites + the cost to stay during certain periods. I decided to write a single-user ECO app using SQLite as the database. This app will track customer information, bookings, properties, and prices; whenever the user is happy they will click a Publish button and it will communicate with a webservice to publish the data (this part is not yet written).
The app uses some practises I would recommend, such as
- Having one EcoSpace per form where possible in order to ensure your memory is freed when no longer needed.
- Using OCL constraints to validate user input - using my DroopyEyes extensions.
- Replacing the IPersistenceService to perform double-check no constraints are broken, and to allow classes to define PreSave validation for more complicated validation (such as doing in-DB searches for clashing bookings so that you don't have to load in all bookings into memory).
- Adding a non-ECO DBStructure table to the DB so that you can detect the current version of the DB and apply relevant SQL upgrade instructions when needed (no upgrade code in there yet).
To run the project you will need to download SQLite. You will also need to remove the AirSoftware.Common and Eco.Persistence.SQLite projects and re-add them (I have copied them into the zip file).
The file is available here. The file uses only a few classes so it will work in the trial too. The project is a Visual Studio 2008 one.