473,386 Members | 1,796 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,386 software developers and data experts.

Serializable()

<Serializable()Public Class Dealer

What does Serializable do?


Regards /Snedker
Sep 6 '07 #1
2 1568
It allows another object to convert your object's properties into a form
that can be transmitted, saved etc and then re-created. As an object is
basically a bunch of binary data you can't do much with it beyond your
existing app.

Marking your object as serialisable means it can be stored in the viewstate,
stored in the session if you're not using in-proc sessions, can be sent via
remoting, web methods etc. What happens is that the object's data is stored
in a property bag type thing, that property bag is saved somewhere
(viewstate, session etc) or sent (remoting etc) then the receiving code will
deserialise the object by creating a new instance of one and setting its
properties as dictated by the property bag. So in psuedo code;

//Take object's property values and store in the viewstate
ViewState ["myObject"] = myObject;

// Create new instance of object, read the property values are read from the
viewstate
// and populate the new object with them
myObject = (MyObjectType) ViewState["myObject"];

The two objects *look* the same as they have the same property values, but
they are not the actual same binary object.

"Morten Snedker" <mo************@gmail.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
<Serializable()Public Class Dealer

What does Serializable do?


Regards /Snedker

Sep 6 '07 #2
thats what serialization does.

setting the Serializable attribute means the object will successfully
serialize if asked to. either the object implements ISerializable or
follows all the rules for the default serialization logic to work.

-- bruce (sqlwork.com)

Aidy wrote:
It allows another object to convert your object's properties into a form
that can be transmitted, saved etc and then re-created. As an object is
basically a bunch of binary data you can't do much with it beyond your
existing app.

Marking your object as serialisable means it can be stored in the viewstate,
stored in the session if you're not using in-proc sessions, can be sent via
remoting, web methods etc. What happens is that the object's data is stored
in a property bag type thing, that property bag is saved somewhere
(viewstate, session etc) or sent (remoting etc) then the receiving code will
deserialise the object by creating a new instance of one and setting its
properties as dictated by the property bag. So in psuedo code;

//Take object's property values and store in the viewstate
ViewState ["myObject"] = myObject;

// Create new instance of object, read the property values are read from the
viewstate
// and populate the new object with them
myObject = (MyObjectType) ViewState["myObject"];

The two objects *look* the same as they have the same property values, but
they are not the actual same binary object.

"Morten Snedker" <mo************@gmail.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
><Serializable()Public Class Dealer

What does Serializable do?


Regards /Snedker

Sep 6 '07 #3

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

Similar topics

3
by: Magnus Byne | last post by:
Hi, I have a problem using serializable transactions. In one transaction I select a single specific row from a table using a where clause (this causes it to acquire and hold a range lock). In...
0
by: xmail123 | last post by:
Hi, 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...
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. ...
5
by: Ben Terry | last post by:
I get the following compilation error: "The type or namespace name 'Serializable' could not be found (are you missing a using directive or an assembly reference?)" Can anyone tell me why the...
0
by: Poewood | last post by:
I am experimenting with saving files in binary format on the Pocket PC. When I use the attribute I get error in Compact Framework. Do i have to use the attribute to make a class serializable? ...
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,...
8
by: Techno_Dex | last post by:
Has anyone come up with a slick way to make Custom Serializable Objects to behave like DataSets when using WebServices? What I'm looking for is some way to force the WSDL generated code to create...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...

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.