Code Generation Real World Part 2
Written on July 11, 2007
This is a continuation of Code Generation Real World Part 1.You may remember I have just drawn the diagram for the class layout for the project -

My GlobalSurfari Facebook System - on paper
So I have my diagram. It is very simple, I have a User object which contains the Facebook ID (fbid), Name and Surf Prediction Default (home) and a Message object, which contains the message the user writes on the ‘wall’ (body), surf prediction the message was written on (home) and the created date of the message (created). As well as a many to one link with the User object.
Now I am just about ready to get going with GENNIT, all I have to do is reproduce this diagram using the designer and I am ready to go. I am going to use the NHibernate C# DAL which comes with GENNIT to create the project.

Create the Project
So I now have a ‘GlobalSurfari FB DAL’ project on GENNIT. I open the designer to re-create my diagram from paper into the system.

Reproduce my paper diagram onto the GENNIT Designer
The Many-to-One link is represented by the user property on the Message object (shown in the above screenshot).
Next step is to Generate the code, I click on the GENNIT link from the dashboard, ensure all the parameters for the project are correct (specifically what the database is named) and download the generated code.

Downloading the code generated project from GENNIT
In Code Generation Real World Part 3 I demonstrate what modifications I made to the downloaded code to get my Global Surfari Facebook Application up and running.
Filed in: Tips and Thoughts.
