For my discussion of application architecture I'm creating an example application to demonstrate some of the concepts and tradeoffs involved. The problem I've chosen is an online movie review site based on the movie review strategy I've recently adopted.
As the first step I'm going to define some requirements. Normally these are sourced from the business using requirements analysis. However in this case I'm just going to make them up. This means that they will be incomplete, inconsistent and wrong in places, which makes them indistinguishable from real requirements. In practice requirements tend to change over time due to shifting business conditions, improved knowledge, politics, changes to environments and many other factors. The practical consequence of this is that your architecture needs sufficient flexibility to cope with these changes.
The requirements from my fictional business are as follows:
- Site provides reviews of movies to public web users
- Multiple reviewers may review a movie
- Each movie gets two scores:
- WIN - A measure of how good the good elements of the film were
- FAIL - A measure of how bad the bad elements of the film were
- Ability to search by:
- Title
- Actor
- Director
- Year of Release
- WIN score
- FAIL score
- Overall ranking (from a ranking function not shown to the end user)
In addition, my application is to be hosted in an existing environment. As such this limits a number of the choices I may make. The environment I'll be using has the following constraints:
- ASP.NET 3.5 running in Medium Trust.
- SQL Server 2005 DBMS
- No ability to run custom services or processes
- No access to Active Directory
- No administrative access to any servers
These constraints define a fairly typical third party shared hosting environment (i.e. mine). If you are building an application to run in an environment you control or can specify you will likely have significantly more access. The main consequences these restrictions impose are:
- All processing must be done in the context of web requests
- Certain third party components such as Castle, Spring.NET and NHibernate will either not work at all or will work only at a reduced level of functionality that compromises their utility. The loss of dependency injection in particular will impact the construction of the application.
Additionally there are some features the business is discussing that may be required in future:
- RSS feeds for reviews
- Population of movie information from external source
- Population of actor information from external source
- Ability for users to comment on reviews
- Email notifications of reviews
- The hosting environment may be brought in-house
We will need to consider to what extent we allow for these possible future requirements in the current design.
In future posts I'll be taking these requirements and turning them into a design that may be implemented.