Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

Will WCF allow me to send custom object graphs over the wire?

Update your Vista Drivers Update Your Drivers Now!!
 
 
Thread Tools Display Modes
Old 03-04-2006   #1 (permalink)
Greg Banister
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 SpecsSystem Spec
Old 03-04-2006   #2 (permalink)
Damon Allison
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 SpecsSystem Spec
Old 03-04-2006   #3 (permalink)
Juval Lowy
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 SpecsSystem Spec
Old 03-04-2006   #4 (permalink)
Greg Banister
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 SpecsSystem Spec
Old 03-04-2006   #5 (permalink)
Juval Lowy
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 SpecsSystem Spec
 

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


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51