FubuValidation: Have validation your way

I’m happy to announce that another member of the Fubu family of projects has been documented. The project of the day is: FubuValidation. As usual, the docs go into far greater detail than I will here but I’ll provide some highlights.


FubuValidation is a member of the Fubu-family of frameworks — frameworks that aim to get out of your way by providing rich semantic models with powerful convention-driven operations. It aims to provide a convention-driven approach to validation while supporting more traditional approaches when needed.

An important thing to note: FubuValidation is NOT coupled to FubuMVC. In fact, it maintains no references to the project.

What’s different about it?

Inspired by the modularity patterns used in the Fubu ecosystem (and previous work with validation), FubuValidation utilizes the concept of an “IValidationSource”. That is, a source of rules for any particular class.

Any number of IValidationSource implementations can be registered and they can pull rules anywhere from attributes to generating them on the fly. You can use the built-in attributes, DSL, or write your own mechanism for creating rules based on NHibernate/EF mappings. The docs have plenty of examples of each.

On top of the extensibility, FubuValidation was designed with diagnostics in mind. While they are currently only surfaced in FubuMVC, the data structures used to query and report on validation rules are defined in FubuValidation. At any point you can query the ValidationGraph and find out not only what rules apply to your class but WHY they apply.

Read the docs

Enough from me. Checkout the new documentation and let us know what you think.

About Josh Arnold

Josh is team lead at Extend Health and a principal developer on the Fubu-family of frameworks. He is a proud husband, terrified but excited father, passionate software guy and coach, closet musician, aspiring man of God, and a perpetual learner.
This entry was posted in General. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • Ted Driggs

    The documentation definitely helps, but it’s not yet complete enough for a newcomer to get up to speed on what FubuValidation can do. Two examples from my first explorations today:
    1. I think the .If() function applies the preceding validations when the provided function evaluates to true. However, my project is not yet in a position where I could test that, the docs don’t mention it, and there is no VS-accessible XML documentation.
    2. I’m not sure how to run validation on a collection of objects and add the notifications from them to the one of the parent collection.
    The library looks awesome, but more documentation is sorely needed.

    • jmarnold


      I’ll start by saying that I should clarify in this post that it’s a START to the documentation. We’re missing a LOT still.

      1) Yes, it applies to the preceding declaration. The tests demonstrate usage but we don’t have a good code snippet to pull into the docs just yet.

      2) I think you just gave me my late night coding assignment. We need a good example of this (and for #1). I’ll see if I can’t whip something up and get it re-published.

      • Ted Driggs

        Thanks, looking forward to it! I’m happy to see Fubu lives on.