Monthly Archives: May 2008

NHibernate FAQ Blog

A lot time ago this blog bring up to us interesting posts about NHibernate, I recommend to you have a look, there a bunch of nice HowTo’s.

Track an IP with a GUI in Visual Basic…

What can I do, I think a “no comments” would be fine :)   

Source: John Papa’s blog

Integrating NHibernate.Validator with Db4o

For who isn’t familiar with NHibernate Validator: it’s a cool framework to validate objects anywhere at our applications. That’s it.

Now, how we can integrate this tool in order to validate the objects before save/update at Db4o? The answer is: very easy. You can download the code at the end of the post.

Remember you can configure NHibernate Validator using .Net Attributes or Xml files. In this case we will se how to do it using the first approach. The class Customer should look like this:

Now how to make the integration using a little helper class ? Like this:

As you see, with a little helper class we can configure the integration with only one line of code, very easy. In this line the method Initialize register before events on the Save/Update at the Db4o Core.

Now, let’s see the validation in action, the below example show the application trying to save an object with an invalid state:

So when the Save/Update is going to happen, first of all, NHibernate Validator check if the entity is into a valid state, if it’s not, an InvalidStateException is thrown, then Db4o wrap it with an EventException, so we have to unwrap the exception to recover the invalid values to display to the user. Would be nice that Db4o don’t wrap the exceptions, but this topic was discussed on this thread.

So, was easy to integrate NHibernate Validator with Db4o. Wasn’t it ?

Download the Example

Sharpen – Conversión inteligente desde Java a C#

I was waiting this release from the Db4o for long time, and the people whom folow to Db4o I think as well.

For the people that are not so familiar, Db4o run onto Java and .Net Platforms. The main development is made at Java, and then using this amazing tool: Sharpen, they make the conversion to nice C# code, although Db4o.Net is not 100% converted, the most part of it it’s.

I hope it helps !

NHibernate.Validator 1.0.0 alpha1 released

Finally you can download the first official drop of NHibernate.Validator. This project began as a port of Hibernate.Validator project, but later was growing up on features, and now has a quite different API, optimized to validate objects integrated with NHibernate and objects of any part of our application. NHibernate Validator allow us to validate objects configured using .Net attributes or nhv.xml files.

Download binaries, source and samples here

Don’t call us, we’ll call you

How does inversion of control look on a system using frameworks ?