-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: NHibernate support added to AndroMDA
PostPosted: Fri Nov 25, 2005 1:08 pm 
Regular
Regular

Joined: Sun Sep 25, 2005 11:35 pm
Posts: 57
AndroMDA (pronounced "Andromeda") is an extensible code generation framework that uses Model Driven Architecture (MDA) to transform UML models into deployable components. The AndroMDA team is excited to announce support for the .NET platform with NHibernate being the key technology used to generate full-fledged data access layers. The model driven approach allows you to describe your application's architecture visually and frees you from hours of repetitive work required to write data access code. You can find an extensive step-by-step tutorial at http://team.andromda.org/contrib/starting-dotnet.html. Please give it a spin and give us your feedback. AndroMDA is supported through a public forum. You can post your questions and comments to http://forum.andromda.org.

Enjoy working with open source MDA!
The AndroMDA team
http://www.andromda.org


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 26, 2005 8:55 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
I gave a quick shot at the tutorial...

IMO, your libraries NHibernate.Support.dll and NHibernate.Nullables2.dll should not have a name starting with "NHibernate." as it gives the feeling that they are part of the official NHibernate package.

Are you planning a support for NHibernate.Mapping.Attributes?

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 26, 2005 10:43 am 
Regular
Regular

Joined: Sun Sep 25, 2005 11:35 pm
Posts: 57
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


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 26, 2005 11:18 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
I just wanted to note that your NHibernate.Support will be part of the future version 1.1 and will be implemented similarly to Hibernate 3.1, i.e. we'll have a CurrentSessionContext interface and a few implementations derived from it.

Nullables2 will certainly be added to core NHibernate in the future.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 26, 2005 11:55 am 
Regular
Regular

Joined: Sun Sep 25, 2005 11:35 pm
Posts: 57
Thanks for the heads-up Sergey. It appears that the best option for us is to change the name of our namespace to AndroMDA.NHibernate and release the code within the AndroMDA project. Once we have CurrentSessionContext support from NHibernate we will switch over to it.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 28, 2005 9:02 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
You may read: How to contribute to NHibernateContrib.

About NHibernate.Mapping.Attributes:

1) I would say: Yes. Note that Hibernate also prefer Annotations usage...

2) Actually, there are some minor issues when mapping very complex objects; they are due to the fact that .NET attributes cannot be nested. But I have never seen a real-world situation.
Anyway, I am planning to add a new feature that will completly solve this issue... And I am committed to maintain it (actually, it is very easy to maintain :) ).

3) Mapping attributes can be inherited so in a case like:
Code:
class Foo // not mapped with [Class]
{
    [Property] int myProperty;
}

[Class]
class FooImpl : Foo
{
}

FooImpl mapping will include the property "myProperty".

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 28, 2005 10:01 am 
Senior
Senior

Joined: Sat May 14, 2005 8:40 am
Posts: 130
KPixel wrote:
About NHibernate.Mapping.Attributes:

1) I would say: Yes. Note that Hibernate also prefer Annotations usage...


Prefer attributes over the xml mapping files? It's a personal preference but I don't think you can say attributes are preferred in general.

_________________
Cuyahoga


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 10:21 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
Yes, it is a personal preference and I agree that, currently, XML files are largely more used than attributes.
But IMO, attributes "should" be more used in the future (in new projects)...

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 11:33 am 
Regular
Regular

Joined: Sun Sep 25, 2005 11:35 pm
Posts: 57
Attributes certainly look like a very attractive option. Based on the discussion above I am going to investigate whether AndroMDA can offer both options.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.