It’s been over a year now since I decided settle down as an independent webdeveloper. Basically, it was just pure coincidence that I started developing Umbraco-based sites, but as we all know, Umbraco is quite addictive once you get the hang of the endless possibilities as a developer.
Now, in this first year as an independent webdeveloper I’ve seen a lot of good stuff out there and certainly a lot of bad stuff aswell! I have seen well-structured Umbraco solutions with just the right (amount of) patterns used and a very welldefined structure matching the ambitions of the solution. Sadly, I’ve also seen what I would like to define as “the ASP.NET developer building a huge website in addition to Umbraco” trying to ignore the Umbraco API at all costs. Don’t get me wrong here, there’s definitely some great ASP.NET/C# developers out there – it’s just a shame they don’t seem to take their time to acquaint themselves with the documentation.
With that said, I don’t consider myself as a software-architect (or some sort of fancy title like that). I still have a lot to learn when it comes to software architecture. However, I think it would be interesting to start an open discussion on how to structure an Umbraco solution and share some experiences across the awesome community. I do know that it’s not all sites that needs 5+ or 10+ different class libraries in Visual Studio After all, we are blessed with a lot of built-in plug-and-play stuff in Umbraco to set up small sites.
I’d like to share how I generally set up a structure for a medium-sized Umbraco solution.
The screenshot below shows the solution in VS2010 that I typically use:
I think the names of the libraries are pretty self-explanatory and typically we could leave some of them out depending on the needs of the solution. I.e. the Interfaces, Model and DAL could be left out if no custom tables/databases are required, the Events library can be left out if we don’t need to hook up on any of the Umbraco events and so on so forth.
Although we could leave some of these libs out, I like to have them there anyway since requirements can/will be changed as the project goes on. Also, some might say that it’s totally overkill to have these libraries, but I actually find it pretty convenient once you have your post build events set up to copy the dll’s.
It would be interesting to know your opinion on this topic and eventually start a discussion on best-practices. I bet there’s just as many ways to structure an Umbraco solution as there are developers out there