I am using a WCF service between the Client side UI (Silverlight 3.0) and the Data Layer. We are using NHibernate for Database Access. So please tell me if my below understanding is correct or not:
- UI calls WCF for a Save Method (for eg).
- The WCF has a Save method in it which actually encapsulates a Save method from the Data
Access Object. - The Data Access Object method of Save in turn encapsulates a default Save Method of
NHibernate which actually saves some Business Object/s into the Database.
Also can someone tell me that how do we pass objects from WCF to the UI (Silverlight 3.0) layer and vice versa. I have read that we use DTO for that. But how does a DTO work? Do they correspond to the ‘Data Contracts’ in the WCF? If not then is the DTO declared on WCF (server) side and Client side code as well?
No, not quite….
Savethe WCF runtime unpacks the parameters and calls that appropriate message on the service class
same steps – basically backwards – are done for response
Important point: the only thing between the client and the server is a serialized message (which could be sent by e-mail or pigeon courier) – there’s no other connection – no “remote object call” or anything like that at all