-->
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.  [ 1 post ] 
Author Message
 Post subject: Confining NHibernate to the data access layer?
PostPosted: Mon Dec 29, 2008 8:15 pm 
Beginner
Beginner

Joined: Fri Jul 06, 2007 9:27 pm
Posts: 22
Is it possible to confine NHibernate to the data access layer? I'm learning NHibernate, and I am finding a lot of code that pollutes business logic with NHibernate code. Often, business logic gets a session from a session provider and passes it to a repository, which uses the session to get domain objects from the database. The business logic ends up managing the session lifecycle.

I'd like to isolate the session to the data access layer. In other words, I'd like my business logic, as well as my domain, to be totally ignorant of NHibernate. For example, I'd like to be able to test the data access layer without my unit test project holding a refwerence to NHibernate.

Here are my questions: Is that practical? Are there any good examples of how to do it? Where?

Thanks for your help.

David Veeneman
Foresight Systems


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

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.