A web store using FubuMVC and CQRS

January 4th, 2010

My wife wants to start a web store selling all kinds of children products like clothing, toys and perhaps some small furniture. So there is a need for an internet store where she can list these products and try to sell them.

I guess the normal procedure would be to try and find a service/product that enables her to do just that, but she married the wrong guy for that, at least until I have to declare defeat.

Anyway I thought that combining my wife’s needs and my own would be an ideal solution, again at least for me, we’ll see what she thinks about it after a while. So what are my needs?

Update: Ok to be more fair, I am using my wife’s ambition to open a web store to create a project for myself. It might be so that we will be using it for her store, but there is a very high likelihood that we will be renting an existing service instead. Even if it was just to not have it get between our marriage :) but as I said I will build it as if it will be used by her.

FubuMVC – v.Reboot

As some of you (or most I actually don’t know my target audience good enough to make these statements) may already know Jeremy Miller has been putting a lot (read amazing amount) of work into FubuMVC replacing/rewriting parts of the original FubuMVC code base that Chad Myers initiated from lessons learned. I encourage you to read this first and second post about this reboot from Jeremy to learn more about it.

But all this does mean that I have to dig deep into the FubuMVC code again and see what has changed and how it now works, sure most of the basic principles are still true, but especially on the configuration side many things have changed. Also the behavior chain as the controller is now an option that I am looking forward to be using. And hopefully I’ll be able to add my own pet peeve; behavior chains for partials even further separating responsibilities.

DDD using CQRS and Event Sourcing

And I want to incorporate CQRS using Event Sourcing into this as well, but not just that I’ll be using this to drive the development of my PI solution for this approach. You may read some initial thoughts about that here. Nothing beats developing something then driven by actual usage. I am also thinking about incorporating Udi Dahan’s thoughts into this by not making my aggregate roots into huge tree structures, but by keeping it as flat as possible.

Sharing by blogging and OSS

I am building this for myself, for my wife really, anyway those are the specifications what I’ll be fulfilling (and yes I am going to try to make this as real as I can). Perhaps it is also time for me to start trying MSpec, but on the other hand I really like to try out Cucumber using Duke4Nuke and TeamCity. It would be great if I could get a public build server for this (CodeBetter?).

Anyway I want to make this completely in the open by providing all the source code via my GitHub account and also blog about the whole process. These posts would be covering everything, so from project setup with FubuMVC till some specifications and all the things that go into the creation of my PI CQRS solution (to early to call it a framework yet).

Now together with writing my book and many other things you should not expect a high speed project where this is build in no-time. So patience is a good thing here.

So?

Well I would like your feedback about this, what do you think about this approach? Also I would need a name for the project, both for the web store and for the PI CQRS solution. I hope you can help me with that, as I am very bad with names (we are currently looking into children names again and my wife will testify that I am indeed very bad at this).

Mark Nijhof CQRS, DDD, FubuMVC

  1. January 4th, 2010 at 16:20 | #1

    Hi Mark,

    Great to hear! I think an example like this will be very valuable for all of us, let’s hope your wife will benefit as well ;)
    One thing about the FubuMVC: one thing I have learnt from consulting – when you introduce new ideas it is a bad move to do many new things at once. That is I think you will be easier for more people to follow you if you introduce the CQRS DDD store using more mainstream web technology (something made by Microsoft) and may be when you have showed enough of the CQRS/DDD stuff, then refactor/switch into FubuMVC.
    Here is an inspiration for an idea for a name: Antonio – http://en.wikipedia.org/wiki/Antonio_(Merchant_of_Venice)

    All the best!

  2. coder
    January 4th, 2010 at 17:39 | #2

    Excellent idea. Will be really looking forward for the next articles.

    ( 1 for MSpec btw)

  3. Ian
    January 4th, 2010 at 17:57 | #3

    Wow, can you read my mind? *laughs* Really looking forward to this!

    I was hoping you’d talk about resolving the differences between your interpretation of CQRS and that of Udis. Will be interesting to follow your thoughts. And I’ve been playing with ideas of using CQRS for an e-commerce website (even if it’s overkill for many situations). FubuMVC seems to be coming of age as people outside of the core developers start taking interest which is great to see. But as Petar said: trying too many things at the same time may be hard to follow if you’re planning on making this more than a purely personal exercise.

  4. January 4th, 2010 at 18:01 | #4

    Sounds great Mark. Have been looking at FubuMVC source code for about a month waiting to see some solid examples. I like the way it is going having ripped out most of asp.net mvc in the last few months in one of my projects to enable something that usually shouldn’t be that hard.

    1 for MSpec too.

  5. Marcos
    January 5th, 2010 at 04:37 | #5

    Wow! I was looking forward to learn more about CQRS and FubuMVC, and you are going to make a sample using both! =) I started using Cuke4Nuke recently, and its a really cool experience, hope you try that too.

  6. Henning Anderssen
    January 5th, 2010 at 09:44 | #6

    Sounds like a really good exercise, both for yourself and your readers.

    I’ve read a lot on DDD and CQRS recently, but as most others I’ve struggled to get a grasp on the ideas and more importantly how to actually develop a system with such techniques.

    I’ve been wanting to make a website of my own, using DDD and more recently CQRS, as well as FubuMVC. Although not a typical site where you’d want to apply such things, I decided to deliberately over-engineer the site as a learning exercise.
    Is that your plan as well, to apply more “stuff” than is really neccessary?

    This project of yours sounds like and hopefully will be a good sample for others to follow and get ideas from. Usually people post rudimentary examples to explain a very narrow problem, but what I usually look for is more grand ideas and implementations, and not just a few lines of code.

    Good luck with your project. I’ll definitely follow along :D

  7. January 5th, 2010 at 17:48 | #7

    With respect to the not doing all things at once comments: I will not drop either technique, I have to use ASP.NET MVC at work and I don’t want to do that here as well because I don’t like it very much. Not compared to FubuMVC at least. And CQRS is a core principle of the domain that I’ll be working on, so that is not something that I would like to ‘refactor’ later on.

    But, in my posts I’ll make sure not to mix them too much if at all. Also in the code I will try to be as clear as possible, basically because that is good practice. I hope that my previous CQRS example was perceived as clear and understandable?

    Also think of introduction posts like how to setup a project for FubuMVC or continuing from my CQRS posts explaining the different aspects of it. But now mostly driven by the web store. Also I always hope to chow enough code in my posts so that you don’t necessarily need to go to the repository to understand what I am talking about.

  8. Szymon Kulec
    January 7th, 2010 at 14:03 | #8

    Hello Mark,
    I’ve read a few Martin Fowler articles about event sourcing and retrospective events and I have one question. How do you want to cope with events versioning?

    Regards
    Szymon

  9. January 7th, 2010 at 16:52 | #9

    @Szymon Kulec
    Event versioning is something that I want to address as well, but then something that is build into the CQRS PI framework, but you basically build converters that you can chain together to come get from version 1 to 2 to 3, and if you get a big enough difference you could do from 1 to version 5. I hope this makes the idea clear, I am going to write a whole post about this as well.

  10. Szymon Kulec
    January 8th, 2010 at 03:16 | #10

    @Mark Nijhof
    Thank you for your answer Mark. I’m very interested in your solution and I hope you describe it soon :)

Comments are closed.