Source Code or Guidlines about CSLA.NET + NHibernate + ActiveRecord

Source Code or Guidlines about CSLA.NET + NHibernate + ActiveRecord

Old forum URL: forums.lhotka.net/forums/t/5926.aspx


jgamba posted on Wednesday, December 03, 2008

Hi,

I am working to implement ORM in my projects (using ObjectFactory). I have chosen NHibernate for their maturity, complemented by the simplicity of ActiveRecord.

Investigating, I found some interesting projects like:

ProjectTrackerNHibernate in http://www.codeplex.com/CSLAcontrib
CslapTrackerFactory in http://cslaptrackerfactory.googlecode.com/

Both are based on NHibernate, but the deal differently. I would like to hear their views on these two projects or others, to take as a base project, or know what do you recommend for my needs.

In general, I want to find documents, websites, blogs, projects, source code, samples, guidlines and so on. Related NHibernate + ActiveRecord, or at least one of the two. All this of course, that can be applied to CSLA.NET.

Thanks in advance

Jorge

rsbaker0 replied on Wednesday, December 03, 2008

I think this approach has promise. I started with a sample NHibernate layer for CSLA in which a common base class was inserted below each of the CSLA main entity classes (e.g. BusinessBase<T>, BusinessListBase<T>...).

In my case, I decided to use a different ORM (Wilson ORMapper), mainly because NHibernate doesn't allow native SQL to be used and generated parameters in a fashion that would cause server optimization problems (e.g. different parameter names on each object invocation, causing queries to not be found in the cache).

Still, I found it a straightforward process and have CSLA cooperating very nicely with the ORM. I can try to dig up the original source code for the layer classes if you are interested.

jgamba replied on Wednesday, December 03, 2008

Of course, I am very interested, please post your source code

Jorge

rsbaker0 replied on Wednesday, December 03, 2008

It turns out I started with the Csla.NHibernate classes in the project tracker sample:

http://www.codeplex.com/CSLAcontrib/Project/Download/FileDownload.aspx?DownloadId=20672

They were pretty easy to translate to use a different ORM (other than a minor factory issue -- NHibernate lets you populate an object created by someone else and my ORM doesn't).

Copyright (c) Marimer LLC