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.  [ 3 posts ] 
Author Message
 Post subject: IUserType adds data layer dependency to domain layer?
PostPosted: Wed Aug 13, 2008 2:53 am 
Newbie

Joined: Wed Aug 13, 2008 2:48 am
Posts: 4
One of the things I like with NHibernate is that my domain model needs absolutely no knowledge of the data layer - all of it is described in separate xml files.

But if I want to use a custom data type, say an Address (roadname, postal code etc.) then my domain class for such an object must implement IUserType - thereby adding a dependency from my domain layer to the data/persistence layer.

Is this correct or have I overlooked something?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 13, 2008 4:22 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
Not necessarily. You can implement the Address class as part of your domain layer and AddressType implementing IUserType in the data access layer of your applicaction. Then you can map a property of type Address with AddressType in the mapping file.

_________________
--Wolfgang


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 13, 2008 2:19 pm 
Newbie

Joined: Wed Aug 13, 2008 2:48 am
Posts: 4
Thanks, I will try that.


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