-->
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.  [ 5 posts ] 
Author Message
 Post subject: Passing domain models in and out an ASP.NET WebService?
PostPosted: Mon May 16, 2005 9:22 am 
Newbie

Joined: Fri May 13, 2005 4:51 pm
Posts: 12
Hello!

I would like to pass NHibernate domain models in and out an ASP.NET WebService.

How do I for instance marshall collections :?:

Should I do something in order to prevent excessive unnecessary database work :?:

Is there some kind of documentation documenting this, I suppose, ordinary situation :?:


Best regards,

Henrik Dahl


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 16, 2005 12:32 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
To pass domain model in and out an ASP.NET WebService, you just need to put the [Serializable] attribute.

I don't see any NHibernate-related problem with this...

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


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 16, 2005 1:49 pm 
Newbie

Joined: Fri May 13, 2005 4:51 pm
Posts: 12
Why should I actually apply the [Serializable] attribute? Isn't the [Serializable] attribute only meant for enabling binary serialization where we here talk about serialization using XmlSerializer during the process of marhsalling in/out the WebService?

I must say that I actually have a problem with marshalling a list. As far as I understand my domain model should use the type "IList". The problem just is, that this leads to deserialization as XmlElement(s) instead of instances of the class the objects in the list were at the client side. Do you know if there is some special issue regarding marshalling IList properties?


A meta question:
I may see you've moved my request to the ASP.NET sub forum. ASP.NET may be either a WebForms or a WebService (or an explicit handler if you do more imperative programming). In the overview of forums on the main forum page it's emphasized "Web Form" for the ASP.NET. I obviously assumed this means that the particular sub forum is only meant for Web Forms.

Best regards,

Henrik Dahl


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 16, 2005 3:31 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
hdahl wrote:
A meta question:
I may see you've moved my request to the ASP.NET sub forum. ASP.NET may be either a WebForms or a WebService (or an explicit handler if you do more imperative programming). In the overview of forums on the main forum page it's emphasized "Web Form" for the ASP.NET. I obviously assumed this means that the particular sub forum is only meant for Web Forms.

Best regards,

Henrik Dahl

I'm the one who wrote those descriptions and I'm not familiar with ASP.NET world, so I'll reword this forum description if you can provide a better one. I think it's best to keep all ASP.NET-related topics in one forum, there aren't going to be a lot of them anyway.


Top
 Profile  
 
 Post subject: Re: Passing domain models in and out an ASP.NET WebService?
PostPosted: Mon Jun 06, 2005 3:05 pm 
hdahl wrote:
Hello!

I would like to pass NHibernate domain objects between tiers.

How do I for instance marshall collections :?:

Should I do something in order to prevent excessive unnecessary database work :?:

Is there some kind of documentation documenting this, I suppose, ordinary situation :?:


Best regards,

Henrik Dahl


It's impossible to pass Domain Model. Domain objects are difficult related and it's impossible to serialize it to XML (see <many-to-one> for ex.).
Other way - use XmlIgnore, but it's wrong architecture (IMHO).

Application server for my app implemented using WSE 2.0 and I am using Data Transfer Objects for passing data between tiers. You can reed about it here: www.martinfowler.com. (or search for "Patterns of enterprise application architecture" in ed2k)

DTO deploying on client and server. To make it Domain model independent you must make Assemblers which only copying properties from domain objects to DTO properties.

Best regards.


Top
  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.