Pierre,
Thanks for trying out AndroMDA. I am glad that you noticed the libraries NHibernate.Support.dll and NHibernate.Nullables2.dll. I wanted to talk about these with the NHibernate team anyway. As you may have noticed the sources for these DLLs are not part of the AndroMDA distribution. I am using them as a stop gap measure until I get some guidance from your team.
I wrote NHibernate.Support after reviewing the various FAQs for NHibernate session management. I have tried to follow recommendations from these FAQs and come up with an interface driven approach to session management. The interface is called ISessionManager. I provide two implementations. The first is called ThreadLocalSessionManager and is intended for use in Console and Windows Forms applications. The second is called HttpContextSessionManager and is intended for use in ASP.NET applications. I feel that this is a very elegant and reusable approach for managing NHibernate sessions and would like to offer the source for inclusion in NHibernate Contrib. Please let me know your thoughts on this. Where can I upload the source for review by your team? I am certainly not married to the package name and open to changing it based on your decision.
NHibernate.Nullables2 was written by James Avery (please see
http://dotavery.com/blog/archive/2005/09/30/5202.aspx). This library supports .NET 2.0 nullables. I did try the Nullables library in NHibernate contrib before switching over to this. The contrib nullables library worked fine, the only issue I found was that the Nullable types did not serialize well over Web Services. Now that .NET 2.0 provides true nullable types, James' library provided the most elegant way to make them work with NHibernate as well as Web Services. Would it be possible to work with James to include his work in NHibernate contrib?
As far as NHibernate.Mapping.Attributes, we were not planning on supporting it, but certainly open to talking about it. Sorry if I sound ignorant in this area; the fact is that I have never tried it myself. Here are some of my questions regarding this library:
1) Is this the preferred approach going forward?
2) Do mapping attributes support everything that is possible with hbm.xml files? Are you committed to maintaining this level of support going forward?
3) You may have noticed that we generate our entities as two classes: a parent class called Foo and a child class called FooImpl. Foo is completely generated by AndroMDA. FooImpl is generated once by AndroMDA and is intended for manual modification by the developer. We will not overwrite FooImpl after its first generation. Note that NHibernate requires us to register FooImpl in the mapping file, not Foo. Does this hold true for mapping attributes too, meaning should the mapping attributes go in FooImpl and not in Foo? If that is the case then we cannot update FooImpl as the model changes and so the approach will not work. Please let me know your thoughts on this.
I am looking forward to working with you and your team to provide top-notch MDA support for NHibernate.
Thanks again for your comments.
Naresh Bhatia