![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Will WCF allow me to send custom object graphs over the wire? I'm creatting a Wimforms SmartClient app where I control both sides of the wire. Will WCF allow me to send my custom objects (including private fields) over the wire as I might have wisdth binary serialization and Remoting? -- Greg |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: Will WCF allow me to send custom object graphs over the wire? Hi Greg, Take a look at the DataContractAttribute and the DataMemberAttribute. You can attribute your classes and fields with these attributes and they can be used over the wire. Here is an example of a small class that is send across the wire in a service. In this example, all the fields are marked as 'Public', however they could just have been marked private. The data contract and OO interface do not have to coincide. Whatever is marked as <DataMember()> will be serialized regardless of the OO scope (private|internal|public). HTH, Damon <DataContract()> _ Public Class PurchaseOrder <DataMember()> _ Public Quantity As Integer <DataMember()> _ Public Part As String <DataMember()> _ Public CustomerID As String End Class <ServiceContract()> _ Public Interface IOrderPersist <OperationContract(IsOneWay:=True)> _ Sub PersistOrder(ByVal order As PurchaseOrder) End Interface Public Class OrderPersist Implements IOrderPersist Public Sub PersistOrder(ByVal order As PurchaseOrder) Implements IOrderPersist.PersistOrder Console.WriteLine("Persisting Order. Customer Id: " & order.CustomerID) System.Threading.Thread.Sleep(5000) '// ToDo: SQL persistence. Console.WriteLine("Order Peristed") End Sub End Class Greg Banister wrote: > I'm creatting a Wimforms SmartClient app where I control both sides of the > wire. > Will WCF allow me to send my custom objects (including private fields) over > the wire as I might have wisdth binary serialization and Remoting? |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: Will WCF allow me to send custom object graphs over the wire? Hello Greg, The short answer is yes - as long as you have a serializable graph, even the same graph from remoting will work just fine. The long answer is that in a SO application, the interaction between a service provider and a service consumer should be in terms of "DoSomething()" not "GetMeYourData()". It is likely that complex graphs are technology specific and increase overall coupling. Hope that helps, Juval Lowy > I'm creatting a Wimforms SmartClient app where I control both sides of > the > wire. > Will WCF allow me to send my custom objects (including private fields) > over > the wire as I might have wisdth binary serialization and Remoting? |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: Will WCF allow me to send custom object graphs over the wire? Juval, I understand your point Re: SOA when implementing Domain Service type functionality, however would you limit the functionality of the client (which is WinForms in my case) in order to maintain the SOA metaphor? Or given a rich client environment would you consider breaking the "DoSomething()" metaphor in order to maintain the type fidelity of your entity data, and enable the utilization of the client environment to execute the kind of logic (validation and even some business logic) that may be isolated to a single aggregate? I appreciate your feedback, Greg Banister -- "Juval Lowy" wrote: > Hello Greg, > > The short answer is yes - as long as you have a serializable graph, even > the same graph from remoting will work just fine. > The long answer is that in a SO application, the interaction between a service > provider and a service consumer should be in terms of "DoSomething()" not > "GetMeYourData()". It is likely that complex graphs are technology specific > and increase overall coupling. > > Hope that helps, > > Juval Lowy > > > > > I'm creatting a Wimforms SmartClient app where I control both sides of > > the > > wire. > > Will WCF allow me to send my custom objects (including private fields) > > over > > the wire as I might have wisdth binary serialization and Remoting? > > > |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: Will WCF allow me to send custom object graphs over the wire? Hello Greg, My reservation was not due to cross-technology or interop issues. I simply think that DoSomething() is better than GetMeTheData() as far as decoupling goes. WCF is not going to stand in your way when sending complex data graphs. Thanks, Juval Lowy > Juval, > I understand your point Re: SOA when implementing Domain Service type > functionality, however would you limit the functionality of the client > (which > is WinForms in my case) in order to maintain the SOA metaphor? Or > given a > rich client environment would you consider breaking the > "DoSomething()" > metaphor in order to maintain the type fidelity of your entity data, > and > enable the utilization of the client environment to execute the kind > of logic > (validation and even some business logic) that may be isolated to a > single > aggregate? > I appreciate your feedback, > Greg Banister >> Hello Greg, >> >> The short answer is yes - as long as you have a serializable graph, >> even the same graph from remoting will work just fine. The long >> answer is that in a SO application, the interaction between a service >> provider and a service consumer should be in terms of "DoSomething()" >> not "GetMeYourData()". It is likely that complex graphs are >> technology specific and increase overall coupling. >> >> Hope that helps, >> >> Juval Lowy >> >>> I'm creatting a Wimforms SmartClient app where I control both sides >>> of >>> the >>> wire. >>> Will WCF allow me to send my custom objects (including private >>> fields) >>> over >>> the wire as I might have wisdth binary serialization and Remoting? |
My System Specs![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Serialization: "Object Graphs" | vmantrana | .NET General | 0 | 08-15-2008 03:08 PM |
| Re: WLM On-the-wire security | Jonathan Kay [MVP] | Live Messenger | 1 | 03-21-2008 07:32 PM |
| 2 Wire with Vista connection problems | Monkeyboy | Vista networking & sharing | 2 | 12-10-2007 11:53 PM |
| Need suggestions for new graphs card | VistaGuineaPig | Vista hardware & devices | 4 | 03-07-2007 09:49 AM |
| Adding canonical aliases for Compare-Object, Measure-Object, New-Object | Alex K. Angelopoulos [MVP] | PowerShell | 2 | 05-26-2006 07:58 AM |