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
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.
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
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.
Martin,
thansk again; thats got me on the way there.
Ged