473,320 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Serializable Flag on a Class

My company has developed a backend component which needs to be carried
around in session state, therefore it must be marked [Serializable] at
the class level.

The problem I have with this is that now any class that this class uses
must also be marked as serializable. This is a huge pain since now we
have a dozen classes marked.

Can someone better explain why we have to chain mark the supporting
classes in the first place? Also, does marking all these classes have
some sort of negative impact?

My idea to get around this was to make one light-weight class (that had
no supporting classes) and then have some sort of factory populate it,
this would therefore only require us to mark it serializable and it
would be our traveling container.

Your feedback on this would be appreciated.

Jun 15 '06 #1
1 1559
Yes its a bit of a pain to do it that way if you have a large object
structure.
An alternative is to use the ISerializable interface.
Here's more info:
http://msdn.microsoft.com/library/de...classtopic.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"MrFile" <mr**********@gmail.com> wrote in message
news:11**********************@y41g2000cwy.googlegr oups.com...
My company has developed a backend component which needs to be carried
around in session state, therefore it must be marked [Serializable] at
the class level.

The problem I have with this is that now any class that this class uses
must also be marked as serializable. This is a huge pain since now we
have a dozen classes marked.

Can someone better explain why we have to chain mark the supporting
classes in the first place? Also, does marking all these classes have
some sort of negative impact?

My idea to get around this was to make one light-weight class (that had
no supporting classes) and then have some sort of factory populate it,
this would therefore only require us to mark it serializable and it
would be our traveling container.

Your feedback on this would be appreciated.

Jun 15 '06 #2

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

Similar topics

8
by: xmail123 | last post by:
Hi, As was pointed out whatever you return from a WebMethod needs to be serializable to SOAP. An ArrayList is not serializable. I will be needing to return other data types from web methods. ...
2
by: jeffpriz | last post by:
I'm having trouble.. I created a small class that I pass to my Pages, and I want to put that class into Viewstate.. I do: Viewstate.add("thisVar", myClassVariable) and i receive the lovely...
2
by: John | last post by:
Hi What is a Serializable class compared to a normal class? Thanks Regards
9
by: Developer | last post by:
Hi, How can one tell wsdl.exe/VS.NET web service proxy generatioon to to put on imported classes? For example, i fin your web service you use a class: class Data { }
1
by: cpnet | last post by:
I have a DataTable defined in a strongly-typed DataSet: public class MyDataSet: DataSet... { ... public class MyDataTable: DataTable... { ...}
3
by: Techno_Dex | last post by:
I'm wanting to create a Wrapper (or Extender depending on how you look at it) for a Serializable object that I then want to send over a webservice. Basically I want to create a Serializable Object,...
4
by: mark4asp | last post by:
I need to add an item to this class which I would like to be public IncumbentManager List<int>; (alternatively it may be an arraylist, but I prefer a List<int>) This is the simplifed code...
1
by: Cirene | last post by:
I'm binding a datagrid to my business object. I get an error that the type 'abcshoppingcart'...is not marked as serializable. So, I added a attribute in the class. But then a blue squiggly...
2
by: shapper | last post by:
Hello, I am using ASP.NET Membership and I know each class that I add to Profile must be Serializable: public class Contacts { public string Address { get; set; } }
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.