-->
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: .NET DataProvider Adapter for NHibernate
PostPosted: Tue Dec 06, 2005 2:53 pm 
Beginner
Beginner

Joined: Fri Nov 11, 2005 1:04 pm
Posts: 22
I have seen a ton of questions regarding the same issue when it comes to nHibernate and Winforms.

Winform development is significantly different from Java Web App development. And with the release of .Net 2.0, ASP.Net web development is moving closer to Winform development.

Both targets have a set of "Data Aware" UI controls that rely on the DataSet to feed them. Does nHibernate support retrieving DataSets from HQL queries?

Is there a way for nHibernate to support implementing a Data Provider
http://msdn.microsoft.com/library/defau ... ovider.asp

This is the path the team SHOULD take if they want to make this more than just a port of Java Hibernate to C#.


Top
 Profile  
 
 Post subject: Re: Fitting a Square peg into a round block.
PostPosted: Tue Dec 06, 2005 5:01 pm 
Regular
Regular

Joined: Mon May 16, 2005 2:15 pm
Posts: 59
ivolved wrote:
Both targets have a set of "Data Aware" UI controls that rely on the DataSet to feed them.


In .Net 2.0 both Windows and Web forms support binding to objects and custom collections.

ivolved wrote:
This is the path the team SHOULD take if they want to make this more than just a port of Java Hibernate to C#.


I disagree. NHibernate is designed to support an MDA and Object centric approach to development. Datasets and their usage are generally a very data-centric approach.

If you want a dataset based O/R M take a look at Deklarit. Or course it is not open source.

BOb


Top
 Profile  
 
 Post subject: Re: Fitting a Square peg into a round block.
PostPosted: Tue Dec 06, 2005 5:21 pm 
Beginner
Beginner

Joined: Fri Nov 11, 2005 1:04 pm
Posts: 22
Pilotbob wrote:
ivolved wrote:
Both targets have a set of "Data Aware" UI controls that rely on the DataSet to feed them.


In .Net 2.0 both Windows and Web forms support binding to objects and custom collections.


Yes but behind the scenes all the "object binding" is really doing is creating a strongly typed DataSet.

Pilotbob wrote:
ivolved wrote:
This is the path the team SHOULD take if they want to make this more than just a port of Java Hibernate to C#.


I disagree. NHibernate is designed to support an MDA and Object centric approach to development. Datasets and their usage are generally a very data-centric approach.

If you want a dataset based O/R M take a look at Deklarit. Or course it is not open source.

BOb


There is nothing wrong with nHibernate supporting an Object centric approach. However, "When in Rome, do as Romans do." Why ignore the RAD advantage that the DataSet brings to App development on the .Net platform because it's not done that way in Java? It's not that nHibernate would even have to do things differently behind the scenes, we just add a DataProvider wrapper (Adapter pattern) around what's already there. That way, a developer can choose which approach to use. And for advanced developers who want to take advantage of the power of a rich domain model while still enjoying the luxury of datasets for presentation, they can enjoy the best of both worlds.

I've actually started the process of developing a DataProvider Adapter for nHibernate. It's a lot easier to demonstrate what I mean with working code than with words.


Top
 Profile  
 
 Post subject: Re: Fitting a Square peg into a round block.
PostPosted: Tue Dec 06, 2005 7:01 pm 
Senior
Senior

Joined: Sat May 14, 2005 8:40 am
Posts: 130
ivolved wrote:

Yes but behind the scenes all the "object binding" is really doing is creating a strongly typed DataSet.


I don't have access to the .NET 2.0 framework sources but I can honestly tell you that when binding objects (or collections of objects), no typed datasets are created automagically. The data-aware controls are looking for specific interfaces (Winforms, with ITypedList and IBindingList) or use reflection to do the databinding.

_________________
Cuyahoga


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 07, 2005 10:44 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
I am not against providing support for Dataset... And I am already thinking about it.

Will you release your DataProvider Adapter for NHibernate?

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


Last edited by KPixel on Thu Dec 08, 2005 12:09 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 07, 2005 2:19 pm 
Beginner
Beginner

Joined: Fri Nov 11, 2005 1:04 pm
Posts: 22
KPixel wrote:
I am not against providing support for Dataset... And I am already thinking about it.

Will you release your DataProvider Adapter for NHibernate?


I definitely will be releasing the Adapter. I'm going to start by implementing IDBDataAdapter. So far I don't see a need to any extensions to the Mapping files to support this.

The first goal is to make a non-invasive layer that uses the Hibernate APIs to implement the appropriate interfaces.

After getting that working properly, I will look at non-breaking changes to the libraries themselves that can optimize the use of the IDataAdapter (eg keeping DataSets in the Cache so that updates don't have to go through the effort of translating from a DataSet back to the object graph). This may involve extensions to the mapping files.

Another route I'd like to explore is using dataset schemas (as generated by VS) to generate nHibernate mappings or using them natively within nHibernate.

On another note, I've seen an excellent example of using the DSL (Domain Specific Language) tools to create a graphic editor for Spring.Net configurations. I think this can be something useful for nHibernate as well.

Sorry if I'm firing off too many ideas at once. If I don't put them in writing somewhere, they'll be forgotten quickly.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 7:48 am 
I don't see the problem....

(N)Hibernate is an ORM (Object Relational Mapper).
So, it means, it works with objects. It is able to persist objects to a relational model, and get data out of a relational model, and put it into objects.

I don't see why nhibernate should support datasets, since, this is a complete other way of working ?

(N)Hibernate 's goal is, imho, to be able to work with a 'domain driven' business logic layer; so, your business objects are objects, and not dataset / datatables.
NHibernate is here to free the developer of glue-ing his domain model with the database.

If you want to work with dataset/datatables, then, you should not be working with nhibernate.
You should use the right tools, for the right job.
If you want to work with domain-objects, use hibernate, or another ORM tool that provides the mapping between objects and rdbms.
If you want to work with dataset/datatables, then, you should use another kind of tool.


Top
  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 11:44 am 
Beginner
Beginner

Joined: Thu May 12, 2005 2:14 am
Posts: 33
Location: Sweden, Sk
Hi

A bit offtopic (maybe).

But the default session implementation are very nice to work with when you are doing asp.net but it feels like it doesnt suit winforms.

Shouldnt it be possible to replace the current implementaion of the session to something that will suit winforms development better.

Im not sure if this is the correct or if its even doable. But I dont like to add code in my poco's when i need to reuse them in a winform application, and I dont want to remove code.

This just a feeling i have had for some time now.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 11:50 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
Well, nothing is white or black... If we can provide support for Dataset without breaking the current architecture, then I think that it is a good thing.

I move this topic to "Related Projects"...

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


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.