Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 1st, 2007, 11:52 AM
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default beerhouse and nhibernate

Is one "better" than the other? Has anyone used these two together? Can they complement each other?
__________________
Alex

- TheBeerHouse Mods Repository
http://www.sashka.com/TheBeerHouse/thebeerhouse.html
  #2 (permalink)  
Old November 2nd, 2007, 02:08 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 10 Times in 9 Posts
Default

rocco,

i don't know thr nhibernate method. could you describe how it works (i.e. at what level and how it persists the data etc). could be a case that for certain 'jobs' one may be better than the other.

drop a brief comparison if possible and we can take it from there.

jimi

http://www.originaltalent.com
  #3 (permalink)  
Old November 2nd, 2007, 03:11 PM
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by jimibt
 rocco,

i don't know thr nhibernate method. could you describe how it works (i.e. at what level and how it persists the data etc). could be a case that for certain 'jobs' one may be better than the other.

drop a brief comparison if possible and we can take it from there.

jimi

http://www.originaltalent.com

Jimi,

NHibernate is .NET port of Java's Hibernate, a popular open-source persistence framework, an ORM, that takes away the necessity to write 90% of the SQL queries, by mapping objects to the databate, and giving the developer a natural object oriented approach to data access.

I've always felt that the custom entity approach (i.e. beerhouse framework) is the way to go, but the ability to get away from writing sql queries is tempting.. So I am wondering how much sense it makes to couple nhibernate with the objectdatasources that the beerhouse uses, and have nhibernate return the data to the ojectdatasources. Since nhibernate provides its own data caching, it leaves me someone confused whether too much redundancy would be introduced as the beerhouse does caching too. I've also heard about Microsoft's LINQ with Entities, maybe thats the way to go instead?
  #4 (permalink)  
Old November 3rd, 2007, 05:25 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 10 Times in 9 Posts
Default

rocco,

surely there must be some sql wrapped in there. it's just that the mapper has created it for you. i'll download it and take a look at it and see what benefits it brings. in the meantime, a must for you would be to look at the flixon site generator as this is a template based orm directly targetting TBH. you can grab it at:

http://www.flixon.com/site-generator/

that way, you'll never have to type another sql statement again - EVER :)

jimi

http://www.originaltalent.com
  #5 (permalink)  
Old November 4th, 2007, 12:29 AM
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jimi,

We had a discussion about the generator before, you probably forgot it was with me. :)
I am sure the sql is deep down inside, but it does a great job of removing any need for the OO developer to worry about it, you just have to set the mappings.

Here is the link to nhibernate:

http://www.hibernate.org/343.html



Alex

- TheBeerHouse Mods Repository
http://www.sashka.com/TheBeerHouse/thebeerhouse.html
  #6 (permalink)  
Old November 4th, 2007, 04:30 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 10 Times in 9 Posts
Default

Alex,

you are of course correct, we did have a discussion about the flixon generator a while back. i'll take a look at nH and try and discover what it's up to. from a lookat it ages ago, i seem to remember explicit mappings in a file for the tables/indexes etc, but this may have changed.

jimi

http://www.originaltalent.com
  #7 (permalink)  
Old November 5th, 2007, 12:41 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:I've always felt that the custom entity approach (i.e. beerhouse framework) is the way to go, but the ability to get away from writing sql queries is tempting.
I agree with hand-designed classes and SQL being the best. I really dislike auto-generated SQL in most cases. But I might live with it if I could tune the maps to ensure that the SQL is both accurate and efficient. But in all honesty, that would take more work than just writing it myself.

Quote:
quote:So I am wondering how much sense it makes to couple nhibernate with the objectdatasources that the beerhouse uses, and have nhibernate return the data to the ojectdatasources.
I would probably not use ObjectDataSources in a general sense with a tool like that. Passing around object collections is the norm there.

Quote:
quote:Since nhibernate provides its own data caching, it leaves me someone confused whether too much redundancy would be introduced as the beerhouse does caching too.
Right - you can't combine them. If you want to use nhibernate you have to rip out the current DAL/BLL architecture.

Quote:
quote:I've also heard about Microsoft's LINQ with Entities, maybe thats the way to go instead?
Oh yeah! That's extremely cool, but it's not ready yet. It will probably take at least 6 more months to finish. A word to the wise (or the wise wannabes), look at the Entity Framework side of that more than the LINQ side. LINQ itself is somewhat trivial in nature and kind-of boils down to syntax. But the Entity Framework is a real work of art.

Eric

  #8 (permalink)  
Old November 5th, 2007, 10:53 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 10 Times in 9 Posts
Default

rocco,

found a pretty good example using the northwind db as the database and am taking a look thro' it. here's a link to the article, plus source files generated by nhibernate for northwind:

http://ralinx.wordpress.com/2007/07/...ping-examples/

jimi

http://www.originaltalent.com
  #9 (permalink)  
Old November 5th, 2007, 06:31 PM
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jimi and Eric,


Quote:
quote:Originally posted by jimibt
 rocco,

found a pretty good example using the northwind db as the database and am taking a look thro' it. here's a link to the article, plus source files generated by nhibernate for northwind:

http://ralinx.wordpress.com/2007/07/...ping-examples/

jimi

http://www.originaltalent.com

Here's another good simple tutorial that I followed:

http://www.hibernate.org/362.html

Yeah, I think Eric summed it up - I don't see the two being compatible.. I've also come across something else regarding ODS and nhibernate:

http://www.codeproject.com/useritems...DataSource.asp

Although I haven't looked at this in any depth at all, I think this one probably doesn't fit well into the decoupling of the layers at all, the authors state this in the beginning. But they also provide a link to this for those who are concerned with the layers:

http://www.codeproject.com/aspnet/NH...tPractices.asp

even though the author starts to make a case for using this orm as compared to a DAL, he still doesn't provide concrete reasons why its easier than maintaining a DAL...

... so ... i guess the best thing is just to work with both methods in more detail and decide which one is preferable. :)

Alex
  #10 (permalink)  
Old November 6th, 2007, 03:37 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 10 Times in 9 Posts
Default

Quote:
quote:Originally posted by rocco50
http://www.codeproject.com/aspnet/NH...tPractices.asp

even though the author starts to make a case for using this orm as compared to a DAL, he still doesn't provide concrete reasons why its easier than maintaining a DAL...

... so ... i guess the best thing is just to work with both methods in more detail and decide which one is preferable. :)
 
Alex
alex,

i took a look thro' and prolly my familiarity with TBH got in the way. at the end of the day, i found that i wasn't overly keen on the concepts i was seeing (i know that it's only thro' use that we become comfortable with things but nH to me looked a bit at odds with how i do most other stuff in c#, whe5her that be asp.net of winforms).

so, i can't really give any real comparison other than to state that my preference for the TBH is compounded by the fact that it is a very transpararent 'standards compliant' architecture whereas i do feel that the nH one really needs to be taken and studied in full and possibly could in some way fit but i for one will await the efforts of others on this front.

jimi

http://www.originaltalent.com
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
General Question about the beerhouse example kss BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 November 26th, 2008 11:08 AM
BeerHouse ASP.NET 3.5? dub.survivor BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 51 October 6th, 2008 11:16 AM
SEO and the beerhouse vantoko BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 12 August 6th, 2007 05:59 PM
the BeerHouse Arabic Localization nesrine C# 0 February 21st, 2007 06:51 AM
BeerHouse from C# to VB.Net nesrine ASP.NET 2.0 Professional 0 February 20th, 2007 06:20 AM



All times are GMT -4. The time now is 06:25 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.