March 2009 Blog Posts

NHibernate, collection with composite-id.

In the previous post we saw how to map an entity with a composite-id. Well but now if you have mapped an entity in this way and you need to create a collection of this entity or maybe you have a related child class that uses this primary keys … you are in trouble! The way to solve the problem is very easy. First of a short example to understand what I’m talking about: 1: class Foo { 2:...

NHibernate and the composite-id.

I’m working with the new version (2.0 GA) of NHibernate. The problem I have encountered today is about the composite-id. Let’s say we have an entity that doesn’t have a personal id field. We don’t want to use the GUID or any other auto id generator class. We must implement the primary key logic in the corresponding table in the database. Now, imagine to have this table: Key Column Name SQL...

UI Validation with the MVP pattern. #Part02.

For anyone of you that didn’t read the first part of this article (that I recommend) this is the address. In this part we will go to build the UI layers, so the user interface, the presentation layer and the Windows form. The user interface. In the MVP pattern the interface in the contract that we want to share from the UI and the presenter. In our case we want to add to simple fields, the username and the password. This is a sample: 1:...

UI Validation with the MVP pattern. #Part01.

This is the first of 3/4 posts about the implementation of the UI Validation in a Windows Form application using the MVP Pattern. In order to be able to follow my article you must have and know: Microsoft Enterprise Library UI Validation, available at this link. Basic knowledge of the MVP pattern. Analysis. First of all I want to explain why I’m going to validate the domain and not the UI. The concept is that a validation represent a constraint on the data. In most of the...

Crisis for credit.

I want to share with you this video as my first come back post. It will explain in few steps what really happened. The Crisis of Credit Visualized from Jonathan Jarvis on Vimeo.