Soon the website that I have been working on will be launched at aids-images.com. It is a website which contains over 1000 images about the complications of HIV, including slides, x-rays and all manner of gruesome images that I wouldn’t recommend seeing if you have a weak stomach.
That said, it is free to register to I encourage you to give it a go
It has been made for Professor Hierschel who is a leading researcher of AIDS. During this project I got to meet the professor when I went on a trip to Geneva. He has been following the AIDS epidemic for 25 years.
For that reason he has a number of images which aren’t generally available anymore because the treatment of AIDS has become far more effective, so the kind of horrible symptoms you see on this site aren’t really seen these days.
I was tasked with the programming aspect, collaborating with a team lead (who also wrote the CSS and HTML) and the editorial team who helped clean the content of the database, using a web interface that I wrote.
Technologies learnt
This project was delayed a lot so I took some time to do some reading on some subjects I wished to expand my knowledge on and try out on this project
Test driven development
Taking this approach seemed very applicable with this project as delays meant that I didn’t have an old database to work with or even a clean set of requirements.
I learnt how to use the Repository Pattern which allowed me to test my business rules without the need for an actual database. I made a number of “service” business classes, such as “ImageService” which allowed users to query the data store and perform business actions.
Each of these services would take a type of Repository (i.e ImageRepository) in its constructor. So when testing I made fake ImageRepositories.
Using new features of .NET 3.5
When querying the database, I used extension methods to create filters on certain types of result. For instance on the search screen you start with a base result set of IQueryable<Image>. Remember at this point the query hasn’t been executed yet, it’s just an expression. Then, depending on what parameters had been passed to the page I would use extension methods to further filter the results.
Results = Results.WithAuthor(myAuthors)
This created a really neat and concise way of querying data, the code is very simple to follow and the SQL created is good.
I got into the habit of actually using the var keyword, this isn’t a big deal but just makes the code a little less verbose.
Var MyImage = new Image()
is certainly better than
Image MyImage = new Image()
..ish :p
LINQ to SQL
I really feel like I made a lot of progress here. Coupled with my nice architecture I built some powerful and complicated queries very elegantly. To do this with stored procedures would have taken me much longer and offered me no where near as much flexibility, although I’ll admit that SQL is not my strongest point as a developer.
ASP MVC
I really like ASP MVC and it was nice to start a new site with it after doing codriver (my issue tracking website) as I had learnt a lot from doing it. I like to think this attempt at it was a lot better this time. I learnt some neat tricks from my research, such as how to elegantly pass data to every view automatically and decorating methods with tags to neatly allow caching and access depending on permissions
EXT JS
The drag and drop interface used for creating sets of images has been copied from our existing image collections interface. That’s not to say that I just copied and pasted and that was it. I had to make a number of modifications and add new features to suit the requirements and I learnt a lot from doing this.
I think the mental scars and fear of doing Javascript from my experiences 5 or so years ago may finally be starting to heal.
The challenge of working with poor structure of previous data
Yes the passwords were stored as plaintext in the old database
We were provided with a MySQL script to create the old database. After working out how to use ODBC to import the data from MySQL into SQL Server I was on my way. I wrote a C# program to try and shoehorn the non-normalized database into my database design.
Final thoughts
When I took on this project I knew it would probably be the biggest one I have done to-date. As usual towards the end of a project you get disillusioned as requirements change and the initial ambitions of the site from the client are compromised for the sake of getting it delivered in time.
That said, as with all my experience in my company I have learnt a lot from it. I am fairly proud of the project, especially when you consider the timeframe I had to do it, the requirements changing quite a lot and the poor quality of the old data.
I learnt how to structure my JavaScript a lot better so I feel in this respect it should be quite easy to maintain
The final solution by no means perfect. My test coverage is pretty poor, I’m fairly sure some of the queries from LINQ could be optimized.
I am nitpicking here though, the client is happy with the website and it is a big improvement on his old site and that’s what counts. The professor will be showcasing the website at the EACS Congress on Friday the 13th of November.
Thankfully, I don’t believe in bad luck…






