Gáspár Nagy on software

coach, trainer and bdd addict, creator of SpecFlow; owner of Spec Solutions

MVC through StoreFront Videos

by Gáspár on December 3, 2008

When I started with my MVC research, I was very happy to see that there is an end-to-end sample from Rob Conery that shows how to develop an application with MVC. And it even uses TDD… cool.

I admit that I have not watched all of them, but the entire series is about 11 hours long, and based on the titles, the first 13 parts were enough for what I wanted to achieve now (I don’t need a richer client, no OpenID, no WF, Logging, PayPal… at least not now).

Now I know that this video series is not good for learning MVC and not even for learning how to develop a web application. For this reason I would not recommend it to anyone.

It is only good for giving you more self-confidence: the others also suck a lot…

Why StoreFront video series is not good for learning MVC:

  • You should not start watching it from the beginning, because Rob does so much refactoring during the development that you should basically forget everything that has been told in the first episodes… they will be invalidated later. E.g.: In the first MVC related episode (#6), he starts with rules, like: “Use an AppHelper class to get content links, and don’t use hard-coded links.” Practical rules! Cool! But if you check the final source code, the AppHelper class is still there, but it is not used at all, all links are hard-coded. What happened? The answer is somewhere in the 9th video stream between episode #7 and #23, but who knows where?
  • You cannot start watching it from the later episodes however, because they heavily depend on the previous ones. You won’t understand anything.
  • It has too much architecture and TDD, and not enough MVC. I think the back-end architecture is far too complicated for this application, and it is sometimes even confusing (see more below). I’m also not sure whether TDD is efficient in the way he does. On the other hand, the final application hardly uses any features of MVC: no validation, no special routes, no real edit forms, etc.
  • It does not solve the problems that you run into if you want to develop a web application using MVC. At least I could not rewrite my 5-page application based on these videos.
  • Finally, I would not recommend the videos for junior developers who want to learn about MVC, because the application architecture is a screwed-up IMHO. It is not really clear for me.
    • He uses two models: one for the db structure and one for the business logic (ok, he also explains that the business domain model can hide the details of the multi-language db structure. Unfortunately the globalization is finally removed from the db, so then what?)
    • He uses an IRepository pattern to access the database objects, but somehow a part of the business logic sneaks into his repository.
    • In this setup, the business domain model entities should be detached from the database logic. But here, these objects may hold references to the repository.
    • He uses a strange lazy loading mechanism to access related entities in the business domain model. Normally you should have lazy loading in the DB model, and only explicit operation in the business model. This way of lazy loading is much less optimal than the ones that OR/Ms can do, but he still has all the disadvantage of attached entities.
    • He has services for storing the business logic, but the logic is somehow scattered around the different other parts.

But still, it is good that Rob created this video series, and actually I think that he was very brave to start with it. I think it is very interesting to see how others develop applications, how they react on new ideas or suggestions of others. I do the same! I also refactor the code, I also make architectural mistakes (and it is not always possible to fix them). It is just not good for MVC learning.

(Not belonging to the topic directly, but the way Rob does the video feeds is very professional. If I’ll have time, I’ll collect the ideas that I have stolen from it in a post.)

Comments are closed.