Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts 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

VB.NET object "bloating" and WCF

Update your Vista Drivers Update Your Drivers Now!!
 
 
Thread Tools Display Modes
Old 06-11-2007   #1 (permalink)
sloan
Guest


 

VB.NET object "bloating" and WCF


VB.NET object "bloating" and WCF.


//quote from web page
This can result in the following undesirable situations:
a.. You end up serializing objects that you didn't expect, resulting in a
larger stream.
b.. If the object handling the events is not Serializable, then the
serialization process will throw an exception.
The root of the problem is the fact that you cannot apply the
<NonSerialized> attribute to events in VB (you can in C# by using the Field:
modifier).
//end quote
from
http://www.codeproject.com/vb/net/se...evbclasses.asp




Does anyone know if this VB.NET object "bloating" (where it serializes more
than it has to) is addressed in 2.0?



The reason I am asking is that I want to go to a WCF architecture, but some
of my back end business objects are already written in vb.net.

I need to know if I need to pay the piper now and translate them to C# to
avoid this issue.

My assumptions are that because WCF relies so heavily on serialization, I
feel this is a big gotcha which could happen.

Anybody have an idea that in VB.net 2.0 if this can be a big WCF gotcha? Or
am I barking up the wrong tree?

Thanks






My System SpecsSystem Spec
Old 06-12-2007   #2 (permalink)
Marc Gravell
Guest


 

Re: VB.NET object "bloating" and WCF

If you use [DataContract] then this is "opt-in" (unlike [Serializable]
which is "opt-out"), so it shouldn't be included.

Otherwise; it is more code, but I'm wondering if custom event
implementation (e.g. http://www.simple-talk.com/content/p...px?article=224)
might be the answer? Then you can presumably control access at the
field level.

But I'm a C# person, so this is only a "perhaps"...

Marc

My System SpecsSystem Spec
Old 06-13-2007   #3 (permalink)
sloan
Guest


 

Re: VB.NET object "bloating" and WCF


Yeah, I'm a C# person as well.
(http://sholliday.spaces.live.com/)

And these VB.NET nuances irk the crap out of me.
99.9% of the time VB.NET is the same as C# (before I get a bunch of posts
telling me how smug I am).
But those 0.1% really bite when you hit them.

Anyway. Like I said, it may be the reason to convert existing code to C#
and be done with it.



...



"Marc Gravell" <marc.gravell@gmail.com> wrote in message
news:1181708459.768742.235450@e26g2000pro.googlegroups.com...
> If you use [DataContract] then this is "opt-in" (unlike [Serializable]
> which is "opt-out"), so it shouldn't be included.
>
> Otherwise; it is more code, but I'm wondering if custom event
> implementation (e.g.

http://www.simple-talk.com/content/p...px?article=224)
> might be the answer? Then you can presumably control access at the
> field level.
>
> But I'm a C# person, so this is only a "perhaps"...
>
> Marc
>



My System SpecsSystem Spec
 

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: "Cannot convert "System.Object[]" to "System.Int32"." Shay Levi PowerShell 3 01-31-2008 04:16 AM
new-object -comobject "CAPICOM.Signed" failing on Win2k3? google PowerShell 2 09-08-2007 09:21 AM
OL2003: Recurring Appointments "object is not valid" on delete kmarlowe Vista mail 2 04-02-2007 03:44 PM
Separate hashtable vs $alist | where-object { "key" = "value" } versus something else? ydroam PowerShell 2 12-12-2006 05:16 PM
False IE doc body error - "Object reference not set to an instance of an object" Alex K. Angelopoulos [MVP] PowerShell 7 07-15-2006 09:46 PM


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