MediaCommMVC 0.3.5

by mgreuel 20. July 2011 22:30

I put quite some effort into v0.4 before realising that rebuilding the application would take too long for just for the sake of doing it. 

But then I had an idea for another project in which I can play with razor, Specflow, Raven DB etc. So I concentrated on the biggest pain points and some features which hab been on my list for some time and called it v0.3.5. I refactored the Data Access, got rid of countless SELECT N+1 and upgraded countless libraries and tools e.g. MVC from 2 to 3, nHibernate from 2 to 3. I also merge all runtime projects, cleaned up the code and fixed several security issues. Furthermore the new version needs much less setup effort (from 13 to 3 steps) and has less external dependencies.

As new features there are notification for new posts/topics, photos or videos as well as an url parser for the forums.

Tags:

MediaCommMVC

MediaCommMVC 0.4 Project Setup

by mgreuel 21. March 2011 18:12

Before starting the development I want to determine the involved frameworks, components and practices.

Web Framework

I will just go with the obvious choice: ASP.NET MVC3 with the Razor view engine. This might not be the most exciting choice, but I haven't used razor before and want to try it.

Specification-/Testframework

I'm really looking forward to using Specflow. On the one hand I want to have automated regression tests to get rid of (or at least reduce) the manual testing. On the other hand I want to have a showcase for the testing team on my current project, because they're always looking for ways to reduce manual testing. I'm not quite sure whether to include the UI, but I'll probably ignore it for starters.

Although I'm fine with MSTest or any other test framework, I'll use NUnit just to try it.

Code Contracts

I've recently introduced code contracts in some components of my current project. I like the idea of code contracts and was excited to see them included in .NET 4.0, but it's a lot of additional work to get them right throughout a project. What is even worse is the tooling. The tools didn't make it into VS2010 so you have to install them separately. That would be ok for me, if the performance wasn't as horrible as it is. Even in a relatively small solutions the static checker completely uses a single core for several minutes and uses up to 1.5GB of ram.

Therefor I'll skip code contracts for now. Hopefully they'll get the tooling right till the next release of VS.

Xml Comments

MediaCommMVC is currently completely document with xml comments and when working in teams I always insist on xml comments. Nevertheless I believe that clean code does not need comments (at least not that verbose), its just much harder (sometimes even impossible) to get people writing clean code than it is to get them writing comments. As I'm working on this alone, I'll try to keep the code clean and not use xml comments.

Solution/Project Structure

In the past I sometimes thougth quite a lot about how to organize projects and split them into assemblies. MVC and DI made me think about physical layers (assemblies) and logical layers separately and after reading an article by Patrick Smacchia I realized that I've no reason to split the project into many assemblies. I'll start with 3 projects in the solution (UI, Core, Test) and try to keep it simple.

[EDIT: VS and Resharper support is significantly better when controller and views are in the same project so I'm down to 2 projects (Web & Tests)]

3rd Parties Libraries

Simple Choice: Nuget. I had some trouble with more complex solutions but this small project it should work just fine.

Database/DAL

It's currently nHibernate with SQL Server. I might look into migrating to Raven DB, but I'm not sure. May be an option for v 0.5 ;)

Tags:

MediaCommMVC

Reflecting and documenting MediaCommMVC development

by mgreuel 14. March 2011 21:08

I released version 0.3 of MediaCommMVC some days ago. Technically it's still alpha, but I've got an small instance running for some time without major problems. I was looking forward to get 0.3 done. Not really because of it's features (I just added html5 videos and some smaller features) but because I get to start rewriting everything for 0.4.

The reason for starting the blog is to force myself to reflect on what and how I'm rewriting it and to document it. Maybe I should start with reflecting on the why:

  • Because I can and its fun ;)
  • Switch to mvc 3 and razor
  • The architecture got a bit ugly. In the beginning it was simple and clean but now there's to much logic leaking into the controllers and repositories. I hope a service layer and view models can help to get it clean again.
  • The design was built around Multiflex which is a real pain as it overrides the styling all possible html elements. I'm really bad as a designer so I'll try to come up with a very simple layout and jQuery UI themes

Not that much after all, but enough for me.

Tags:

MediaCommMVC