-->
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.  [ 11 posts ] 
Author Message
 Post subject: MyContrib: adds 2.0 generic collections, nullables, dbmgr
PostPosted: Fri Aug 19, 2005 12:16 am 
Regular
Regular

Joined: Fri May 13, 2005 4:08 pm
Posts: 64
I have been working on a C# 2.0 project I call MyNHibernateContrib that adds support for many of the .NET 2.0 features that NHibernate does not yet officially support. It's still a work in progress, but I use it on all my projects and find it very useful. It adds support for these features:

    Nullable types (C# 2.0 style)
    Generic collections
    Parent-child collections that manage setting the child's parent reference automatically.
    A session manager base class that provides: 2.0 Generic methods for getting individual or lists of entities, methods to clear and initialize database, including adding some initial data at each reconstruction of the database, and methods to help get sessions properly handled for ASP.NET web sites.


It's a growing project--one that I hope to get adopted by NHibernate into its NHibernateContrib project, or started as NHibernateContrib20 for .NET 2.0 additions.

Anyway, I'm releasing it as LGPL. I encourage patches and updates while I get it ready to submit for an official NHibernateContrib-type project. I still need a test project to verify proper operation (for NHibernate to accept it, and good form anyway), and I need to write some example use cases for it, as the generic collections still need a little bit of plumbing code to be added for users of it in order to get it to work with NHibernate.

Check out the source code here:
http://fhsssvn.byu.edu/Libraries/MyNHibernateContrib/trunk/

Comments welcome!


Last edited by aarnott on Fri Aug 19, 2005 2:56 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 19, 2005 9:30 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
Hi,

As I still haven't start using .NET 2.0, I can't give you meanful feedbacks...

Anyway, it is a good contribution which deserve to be in NHibernateContrib.

As you said some unit tests and example applications would be useful.
Can you also write a "readme.txt" ? (or a full documentation if you can ;) )

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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 19, 2005 10:08 am 
Regular
Regular

Joined: Fri May 13, 2005 4:08 pm
Posts: 64
KPixel wrote:
As you said some unit tests and example applications would be useful.
Can you also write a "readme.txt" ? (or a full documentation if you can ;) )


I will just as soon as I can (a few days and I'll be done, I think).

One more feature that this library provides that I forgot to mention: It simplifies the scenario where you have a one-to-many parent-child relationship, where parents point to children and children have references to their parent. Without this library, two steps are required to add a child:
Code:
parent.Children.Add(child);
child.Parent = parent;

Now with this library, all you have is:
Code:
parent.Children.Add(child);

And the library sets the Parent attribute for you. And removing the child from the parent's collection also sents Child.Parent to null.

As with the generic collection wrapper classes in the library, a little bit of plumbing is required, but much less than would otherwise be necessary to implement this. And as with all the other functionality, some documentation is necessary, which I'll put up on that repository ASAP.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 19, 2005 2:58 pm 
Regular
Regular

Joined: Fri May 13, 2005 4:08 pm
Posts: 64
Ok, I've added a bunch of VS2005-style unit tests to the project. Not quite all of which are implemented, but they should be easy enough to read to get an idea of how to code using the library. I also trimmed the last directory from the URL in my first post, so that the unit tests and license files are visible.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 29, 2005 4:40 pm 
Newbie

Joined: Tue Sep 20, 2005 10:22 pm
Posts: 6
I was wondering if you ever created any docs for this? As i am bit confused on how to use it with my project. Especially the nullable types.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 29, 2005 5:19 pm 
Contributor
Contributor

Joined: Sat Sep 24, 2005 11:25 am
Posts: 198
I took a look at the code, and I don't see how this is working in complex scenarios where you've more than one collection per class.

I'm working on a patch for NHib that would enable generic sets & two ways connections. I hope to be done with it this weekend.


Top
 Profile  
 
 Post subject: Lots of enhancements and example app
PostPosted: Mon Jan 16, 2006 1:49 pm 
Regular
Regular

Joined: Fri May 13, 2005 4:08 pm
Posts: 64
I have enhanced MyNHibernateContrib tons over the last several months, and I have added an example web app and library that demonstrates using two-way collections, generics and nullables. Same URL as before. Hope others find this useful.

So, how's that .NET 2.0 version of the NHibernateContrib library looking? I'd like to add my library to it once it's available.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 4:54 pm 
Senior
Senior

Joined: Thu Aug 25, 2005 3:35 am
Posts: 160
cool, go for it.

how does this compare against ayende's project? What made you want to write this yourself?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 4:59 pm 
Regular
Regular

Joined: Fri May 13, 2005 4:08 pm
Posts: 64
TheShark wrote:
how does this compare against ayende's project? What made you want to write this yourself?

I started this project several months ago, and at the time there was not another project going that did this -- at least not as far as the NHibernate forum seemed to know about.

I don't know anything about ayende's project. A quick google search picked out http://www.ayende.com/projects/nhibernate-query-analyzer/generics.aspx
which may be what you're referring to. If so, mine may be inferior, at least in style if not in capability. I'll have to learn more about it.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 7:31 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
.NET 2.0 features are being added to CVS HEAD now, so I'm also curious how this compares and what features are/will be different.


Top
 Profile  
 
 Post subject: .NET 2.0 features (was: MyContrib: adds 2.0 generic...)
PostPosted: Sun Jan 22, 2006 5:12 am 
Beginner
Beginner

Joined: Wed Aug 10, 2005 6:21 pm
Posts: 24
Location: Antwerp, Belgium
k-dub wrote:
.NET 2.0 features are being added to CVS HEAD now, so I'm also curious how this compares and what features are/will be different.


Erm... Am I the only one who doesn't know which .NET 2.0 features are being added ? I'm guessing it's strongly-typed collections but as I have seen from Ayende's efforts, there are many ways to skin a cat. I'm curious as to how the NHibernate team is skinning it. :-)

Or have I missed a thread somewhere discussing this ?

Sven


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 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.