It´s been a while + Stormwind Reports
I realize it´s been a while since I´ve posted anything. For that I ask for forgiveness for you, my readers (both of you! hehehe). I hope to make up for reduction of information flow with the open source projects I´m managing. Let´s get to them.
Validation Everywhere
Well after using Validation Application Block(VAB), the feeling of love between me and my Validation Everywhere project is growing non-stop. I´ll explain why: My project may be not as featureful as VAB is, but it´s by far lighter. It does not have any unneeded references, you don´t have to configure anything, it does what it´s meant to do.
The approach is simple. Decorate any object (business, view, whatever) with validation attributes and run it against a ValidationContext object, or configure the ValidationContext object with whatever validators you´d like and run it against 3rd-party objects. You get to choose even to implement your own validators (VERY VERY EASY). I hope to see some people at least give it a try. Check it out here.
NMVP - .Net Model-View-Presenter
This is my baby, lol. This is the project I´m writing a book about. This is *the most* solid framework I´ve ever built. In the company I work for we got several modules on different kinds of applications built on top of it.
I can assure that it has helped a lot in building solid, testable, composable applications that allow me to get each dev in my team to write a part of the module without need of interacting (code, not socially) with each other. So I parallelized the development for a single module that otherwise would be centralized in one developer.
On the other hand, this is the one that gets me most sad, since I believe I don´t devote the proper amount of time for it.
I want to finish the NMVP Software Factory so people can use this project in a simpler way.
I want to develop several Conventions-Over-Configuration new features (Sadek I know you´ve asked for it since the very beginning!).
I want to integrate it in the AMAZING MVC framework that Hamilton Veríssimo and several other talented people build: Castle Monorail. This integration is REALLY cool since it´ll allow the Monorail framework to use the composeability part of NMVP. It´ll also allow you to build presenters that focus on the contract instead of databound objects only. I still gotta devote some time thinking about it.
I want, above all else, to finish my book on this framework. I realize that writing the book won´t spread the word on it and that I´ve gotta come up with documentation on the framework at the same level that Castle does, but I really feel that I´ve gotta complete it. It´s a personal thing.
Stormwind Reports (*NEW*)
This one is new, so you don´t know about it. If you, like me, are a really anxious person, please take a look at the Stormwind Reports website. If you´re not keep reading.
I write a lot of business apps in the company I work for. I´ve been writing this sort of app ever since I´ve started programming, for about 10 years now. One thing that has annoyed me in all of these years has been the reporting options we have to build apps.
Technology keeps improving, yet I´m still to see a reporting app/framework/server/whatever that´ll allow me to write a new report in minutes, that´s available to users of my apps and that allows my users to filter/query the report in the way they want to. No, I´m not talking about Crystal illusion (or disillusion perhaps). I don´t want my users to learn how to use language XYZ, because if they did they wouldn´t be business users, they´d be developers (or trying at least).
I want something that allows developers to write reports blazingly fast, users to query them in a very easy way, and one that uses my current Domain Model. Yes, that´s absolutely right. No SQL! I already mapped my stuff in my Domain Model. I don´t want to do it again, and god NO, I don´t want my users to even think about that.
So instead of writing YARE (Yet Another Reporting Engine), as tempting as that sounds, I tried to think as a reporting developer. What do I want to write? Well it came out something in the lines of:
I want my Customer and Order objects, where Order.Date > 10/10/2006 and Order.Value > 1000.00, and I want to see a list of orders grouped by Customer.State, then by Customer. The list of orders should have order id, value and date, and the customer group should have Id, Name and State. Also order it by value.
Cool! That settles the data source part of my report. As you can see I want it OO, and I want it now! So I gotta decide on the template for this report now. That´s what I did next:
<Group GroupBy="Customer.State" Title="{0}" Values="Customer.State.Name"> <ItemTemplate>
<Group GroupBy="Customer.Id" Title="[{0}] {1}" Values="Customer.Id, Customer.Name"> <ItemTemplate>
<Column Width="33%" Header="Order Id">
<Field Values="Order.Id" />
</Column>
<Column Width="33%" Header="Date">
<Field Values="Order.Date" Format="dd/MM/yyyy" />
</Column>
<Column Width="33%" Header="Value">
<Field Values="Order.Value" />
</Column>
</ItemTemplate>
<FooterTemplate>
<Column>
<Text value="Totals:" />
</Column>
<Column HorizontalAlignment="Center">
<Count />
</Column>
<Column HorizontalAlignment="Right">
<Sum FieldName="Order.Value" Format="N2" />
</Column>
</FooterTemplate>
</Group>
</ItemTemplate>
</Group>
" W000000000000T? That´s absolutely impossible." was my first thought (not really but hey let´s settle on that!). When I reach a point that I find something to be extremely difficult or unlikely, but I believe in a spark of feasibility (is that a word?), I *MUST* do it. It´s like cocaine to me. Well, so I settled on to build it.
Let me first acknowledge what must be acknowledged. Huge congrats for both Castle for it´s amazing ActiveRecord framework and for the NHibernate community developers for a ridiculously good OR Mapper. HQL is what made possible this report engine (for me, since the DataBroker is injected, so you can roll your own for your own flavor of Domain Model framework).
After building the engine that grabs data for me I went on to build the Rendering part of the report. That is kinda harder than the first part since there are lots of variables. So at this time I reached to my personal Xml/Xsl expert Claudio Figueiredo (convincing him to come to the Blogosphere right now!). He´s helping me on shipping this project. I hope to have more news for you in a week or two. The project is evolving pretty fast and I´m having a blast building it.
Conclusion
I´ve written A LOT more than I should and A LOT less than I want to. I´ll leave my NextGen Stack post for the next opportunity. I gotta write something about the frameworks that are making my hair look like Marge Simpson´s. I´m very very glad that I work in an industry that has so many geniuses like ours. :D

#105