473,812 Members | 3,417 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
<NonSerializeda ttribute 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

Jun 11 '07 #1
2 1769
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

Jun 13 '07 #2

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" <ma**********@g mail.comwrote in message
news:11******** **************@ e26g2000pro.goo glegroups.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

Jun 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
28673
by: John Smith | last post by:
After reading C# documentation the Conditional attribute seemed the way to go, but after inspecting the IL it seems those methods are still there and I imagine the CLR removes them. Using #if DEBUG means the code does not even reach the IL when compiling in release mode. Is there any benefit to using the Conditional Attribute? Am I right in thinking there will small performance overhead using over #if DEBUG.
10
2027
by: Luke Meyers | last post by:
So, just a little while ago I had this flash of insight. It occurred to me that, while of course in general there are very good reasons for the conventional two-file header/implementation separation for each C++ class, there are cases in which this paradigm contributes nothing and simply introduces extra boilerplate overhead. The particular case I have in mind is CppUnit tests. Each test header is only ever included by the...
4
1978
by: CeeBeeSky | last post by:
I am using Access 2003 but my Access file is in 2000 format. I have deleted some data (some unused customers in the "Customer" table and some old Orders from the "Order" table). I did this to try and reduce the size of my file. I have tried the "compact on close" but that does not make a difference in the size of the file. Does anyone have any suggestions? BTW - this file has gone thru numerous revisions over the years.
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10664
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10404
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10417
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9220
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7678
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3881
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3029
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.