Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# gedw99 10/18/2006 9:25 PM
i want to make some fo the modles web service aware.

My main concern is the Data Layer and he use of objects from Nhibernate.

Will the fact that NHibernate is involved mean that wrapping a Cuyahoga module with a web service call insanely difficult?


Ged
# martijnb 10/19/2006 3:04 PM
gedw99Will the fact that NHibernate is involved mean that wrapping a Cuyahoga module with a web service call insanely difficult?

No, with web services, you should not expose the domain objects directly via the services, but with dedicated data transfer objects that are modelled following the service contract. Regardless of NHibernate , this is always (in my opinion) the preferable approach.
# gedw99 10/24/2006 3:50 AM
Martin,

As Always thansk for the great supprt.

I know that for good architecture i should decouple the doman objects from the Web service DTOs. I agree that for an enterprise product you do this.

But i just need to expose a select few things. Is it technically possible. I was wondering if the NHibernate state will have problems with sending the object out, and then back again?

Alos, i expect that my web service will have to use sessions, since NHibernate relies on them for state. YES?

Gerard
# martijnb 10/25/2006 3:44 PM
gedw99But i just need to expose a select few things. Is it technically possible. I was wondering if the NHibernate state will have problems with sending the object out, and then back again?

Yes, that is going to be problematic because of the lazy loaded collections and the proxies. A solution might be to ensure everything is initialized before sending the object over the wire.
Alos, i expect that my web service will have to use sessions, since NHibernate relies on them for state. YES?

No, not at all. An NHibernate session has nothing to with a web session. You have to make sure that the NHibernate Session doesn't live longer than a single web request to keep it as short as possible.
# gedw99 11/23/2006 2:32 PM
Martin,

thansk again; thats got me on the way there.



Ged