473,324 Members | 2,535 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,324 software developers and data experts.

question about serialization

Hi,

i read several articles about serialization. I know now that it is a process
of converting an object into a stream of data so that it can be is easily
transmittable over the network or can be continued in a persistent storage
location.

Now i did some tests in order to understand it better:
I first executed the code below (this (summarized) code produces a virtual
simple shopping cart which is put in the Profile of the user) with the
attribute "<Serializable()>" and with what follows in web.config:

<profile><properties>
<add name="myCart" serializeAs="Binary" type="mai.eCommerce.elist"/>
</properties></profile>

After that, i executed it again without the attribute "<Serializable()>" and
without "serializeAs="Binary" from web.config.

I couldn't notice any difference (nor in table 'Profiles', nor in the table
'Orders' where the orders are put, nor in the shopping cart, nor in speed
nor in cache, nor in CPU ..).

So my question is:
------------------
what happens (physically on the client/server computer) in this present
application when using serialization what not (physically) happens when not
using it?

Thanks
Casper

<Serializable()_
Public Class listitem
Private _description As String

Public Sub New()
End Sub

Public Property description() As String
Get
Return _description
End Get
Set(ByVal value As String)
_description = value
End Set
End Property
End Class
'--------------------------
<Serializable()_
Public Class elist
.....
Public Sub New()
_items = New List(Of listitem)
End Sub
......
Public Sub Insert(ByVal Price As Decimal, ByVal description As String)
.....
End Class
Mar 19 '07 #1
8 953
the attribute Serializable just states the object can be serialized
using the default serialization logic (all properties are simple or have
implemented ISerializable).

you can set the attribute on classes that will not serialize and no
error will be thrown until runtime when a serialization is attempted and
fails (serialization finds a property of a type it can not serialize)

-- bruce (sqlwork.com)

Casper wrote:
Hi,

i read several articles about serialization. I know now that it is a process
of converting an object into a stream of data so that it can be is easily
transmittable over the network or can be continued in a persistent storage
location.

Now i did some tests in order to understand it better:
I first executed the code below (this (summarized) code produces a virtual
simple shopping cart which is put in the Profile of the user) with the
attribute "<Serializable()>" and with what follows in web.config:

<profile><properties>
<add name="myCart" serializeAs="Binary" type="mai.eCommerce.elist"/>
</properties></profile>

After that, i executed it again without the attribute "<Serializable()>" and
without "serializeAs="Binary" from web.config.

I couldn't notice any difference (nor in table 'Profiles', nor in the table
'Orders' where the orders are put, nor in the shopping cart, nor in speed
nor in cache, nor in CPU ..).

So my question is:
------------------
what happens (physically on the client/server computer) in this present
application when using serialization what not (physically) happens when not
using it?

Thanks
Casper

<Serializable()_
Public Class listitem
Private _description As String

Public Sub New()
End Sub

Public Property description() As String
Get
Return _description
End Get
Set(ByVal value As String)
_description = value
End Set
End Property
End Class
'--------------------------
<Serializable()_
Public Class elist
....
Public Sub New()
_items = New List(Of listitem)
End Sub
.....
Public Sub Insert(ByVal Price As Decimal, ByVal description As String)
....
End Class

Mar 19 '07 #2
Casper,
With the serializable tag before your class, your class becomes
serializable, withouth that it does not even do that.

Cor

"Casper" <c@px.xschreef in bericht
news:uL*************@TK2MSFTNGP03.phx.gbl...
Hi,

i read several articles about serialization. I know now that it is a
process of converting an object into a stream of data so that it can be is
easily transmittable over the network or can be continued in a persistent
storage location.

Now i did some tests in order to understand it better:
I first executed the code below (this (summarized) code produces a virtual
simple shopping cart which is put in the Profile of the user) with the
attribute "<Serializable()>" and with what follows in web.config:

<profile><properties>
<add name="myCart" serializeAs="Binary" type="mai.eCommerce.elist"/>
</properties></profile>

After that, i executed it again without the attribute "<Serializable()>"
and without "serializeAs="Binary" from web.config.

I couldn't notice any difference (nor in table 'Profiles', nor in the
table 'Orders' where the orders are put, nor in the shopping cart, nor in
speed nor in cache, nor in CPU ..).

So my question is:
------------------
what happens (physically on the client/server computer) in this present
application when using serialization what not (physically) happens when
not using it?

Thanks
Casper

<Serializable()_
Public Class listitem
Private _description As String

Public Sub New()
End Sub

Public Property description() As String
Get
Return _description
End Get
Set(ByVal value As String)
_description = value
End Set
End Property
End Class
'--------------------------
<Serializable()_
Public Class elist
....
Public Sub New()
_items = New List(Of listitem)
End Sub
.....
Public Sub Insert(ByVal Price As Decimal, ByVal description As String)
....
End Class

Mar 20 '07 #3
Thanks for replying, but to be honest, i still don't know what really
happens (i mean physically on th computer) when using it and when not. Does
serialization (binary in this case) use a temporary storage, Cache, is the
way of storing profile data in the Profiles table of ASPNET.MDF else than
when not using it, ... such kind of things.
All i read about that is very abstract and that's why i ask for a pratical
explanation instead of a theoretical.
Thanks in advance.
"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:O$**************@TK2MSFTNGP03.phx.gbl...
Casper,
With the serializable tag before your class, your class becomes
serializable, withouth that it does not even do that.

Cor

"Casper" <c@px.xschreef in bericht
news:uL*************@TK2MSFTNGP03.phx.gbl...
>Hi,

i read several articles about serialization. I know now that it is a
process of converting an object into a stream of data so that it can be
is easily transmittable over the network or can be continued in a
persistent storage location.

Now i did some tests in order to understand it better:
I first executed the code below (this (summarized) code produces a
virtual simple shopping cart which is put in the Profile of the user)
with the attribute "<Serializable()>" and with what follows in
web.config:

<profile><properties>
<add name="myCart" serializeAs="Binary" type="mai.eCommerce.elist"/>
</properties></profile>

After that, i executed it again without the attribute "<Serializable()>"
and without "serializeAs="Binary" from web.config.

I couldn't notice any difference (nor in table 'Profiles', nor in the
table 'Orders' where the orders are put, nor in the shopping cart, nor in
speed nor in cache, nor in CPU ..).

So my question is:
------------------
what happens (physically on the client/server computer) in this present
application when using serialization what not (physically) happens when
not using it?

Thanks
Casper

<Serializable()_
Public Class listitem
Private _description As String

Public Sub New()
End Sub

Public Property description() As String
Get
Return _description
End Get
Set(ByVal value As String)
_description = value
End Set
End Property
End Class
'--------------------------
<Serializable()_
Public Class elist
....
Public Sub New()
_items = New List(Of listitem)
End Sub
.....
Public Sub Insert(ByVal Price As Decimal, ByVal description As String)
....
End Class


Mar 20 '07 #4
serialization allows a class instance to write its values to a binary
stream of bytes. these byte an be deserialized to create a new class
instance with the same values. this is know as class persistence (google
this phrase).

thus if you store a class instance in a profile, the class is serialized
to bytes and the data written to a sqlserver table. when requested from
the profile, sql is read, and the bytes are used to create a new class
instance that has the same values of the old.

-- bruce (sqlwork.com)

Casper wrote:
Thanks for replying, but to be honest, i still don't know what really
happens (i mean physically on th computer) when using it and when not. Does
serialization (binary in this case) use a temporary storage, Cache, is the
way of storing profile data in the Profiles table of ASPNET.MDF else than
when not using it, ... such kind of things.
All i read about that is very abstract and that's why i ask for a pratical
explanation instead of a theoretical.
Thanks in advance.
"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:O$**************@TK2MSFTNGP03.phx.gbl...
>Casper,
With the serializable tag before your class, your class becomes
serializable, withouth that it does not even do that.

Cor

"Casper" <c@px.xschreef in bericht
news:uL*************@TK2MSFTNGP03.phx.gbl...
>>Hi,

i read several articles about serialization. I know now that it is a
process of converting an object into a stream of data so that it can be
is easily transmittable over the network or can be continued in a
persistent storage location.

Now i did some tests in order to understand it better:
I first executed the code below (this (summarized) code produces a
virtual simple shopping cart which is put in the Profile of the user)
with the attribute "<Serializable()>" and with what follows in
web.config:

<profile><properties>
<add name="myCart" serializeAs="Binary" type="mai.eCommerce.elist"/>
</properties></profile>

After that, i executed it again without the attribute "<Serializable()>"
and without "serializeAs="Binary" from web.config.

I couldn't notice any difference (nor in table 'Profiles', nor in the
table 'Orders' where the orders are put, nor in the shopping cart, nor in
speed nor in cache, nor in CPU ..).

So my question is:
------------------
what happens (physically on the client/server computer) in this present
application when using serialization what not (physically) happens when
not using it?

Thanks
Casper

<Serializable()_
Public Class listitem
Private _description As String

Public Sub New()
End Sub

Public Property description() As String
Get
Return _description
End Get
Set(ByVal value As String)
_description = value
End Set
End Property
End Class
'--------------------------
<Serializable()_
Public Class elist
....
Public Sub New()
_items = New List(Of listitem)
End Sub
.....
Public Sub Insert(ByVal Price As Decimal, ByVal description As String)
....
End Class

Mar 20 '07 #5
http://www.vb-tips.com/dbpages.aspx?...a-c891846eaf0b

A simple one

Cor

"Casper" <fj;c@px.xfgfgschreef in bericht
news:%2****************@TK2MSFTNGP03.phx.gbl...
Thanks for replying, but to be honest, i still don't know what really
happens (i mean physically on th computer) when using it and when not.
Does serialization (binary in this case) use a temporary storage, Cache,
is the way of storing profile data in the Profiles table of ASPNET.MDF
else than when not using it, ... such kind of things.
All i read about that is very abstract and that's why i ask for a pratical
explanation instead of a theoretical.
Thanks in advance.
"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:O$**************@TK2MSFTNGP03.phx.gbl...
>Casper,
With the serializable tag before your class, your class becomes
serializable, withouth that it does not even do that.

Cor

"Casper" <c@px.xschreef in bericht
news:uL*************@TK2MSFTNGP03.phx.gbl...
>>Hi,

i read several articles about serialization. I know now that it is a
process of converting an object into a stream of data so that it can be
is easily transmittable over the network or can be continued in a
persistent storage location.

Now i did some tests in order to understand it better:
I first executed the code below (this (summarized) code produces a
virtual simple shopping cart which is put in the Profile of the user)
with the attribute "<Serializable()>" and with what follows in
web.config:

<profile><properties>
<add name="myCart" serializeAs="Binary" type="mai.eCommerce.elist"/>
</properties></profile>

After that, i executed it again without the attribute "<Serializable()>"
and without "serializeAs="Binary" from web.config.

I couldn't notice any difference (nor in table 'Profiles', nor in the
table 'Orders' where the orders are put, nor in the shopping cart, nor
in speed nor in cache, nor in CPU ..).

So my question is:
------------------
what happens (physically on the client/server computer) in this present
application when using serialization what not (physically) happens when
not using it?

Thanks
Casper

<Serializable()_
Public Class listitem
Private _description As String

Public Sub New()
End Sub

Public Property description() As String
Get
Return _description
End Get
Set(ByVal value As String)
_description = value
End Set
End Property
End Class
'--------------------------
<Serializable()_
Public Class elist
....
Public Sub New()
_items = New List(Of listitem)
End Sub
.....
Public Sub Insert(ByVal Price As Decimal, ByVal description As String)
....
End Class



Mar 20 '07 #6
Thanks both
"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:un**************@TK2MSFTNGP03.phx.gbl...
http://www.vb-tips.com/dbpages.aspx?...a-c891846eaf0b

A simple one

Cor

"Casper" <fj;c@px.xfgfgschreef in bericht
news:%2****************@TK2MSFTNGP03.phx.gbl...
>Thanks for replying, but to be honest, i still don't know what really
happens (i mean physically on th computer) when using it and when not.
Does serialization (binary in this case) use a temporary storage, Cache,
is the way of storing profile data in the Profiles table of ASPNET.MDF
else than when not using it, ... such kind of things.
All i read about that is very abstract and that's why i ask for a
pratical explanation instead of a theoretical.
Thanks in advance.
"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:O$**************@TK2MSFTNGP03.phx.gbl...
>>Casper,
With the serializable tag before your class, your class becomes
serializable, withouth that it does not even do that.

Cor

"Casper" <c@px.xschreef in bericht
news:uL*************@TK2MSFTNGP03.phx.gbl...
Hi,

i read several articles about serialization. I know now that it is a
process of converting an object into a stream of data so that it can be
is easily transmittable over the network or can be continued in a
persistent storage location.

Now i did some tests in order to understand it better:
I first executed the code below (this (summarized) code produces a
virtual simple shopping cart which is put in the Profile of the user)
with the attribute "<Serializable()>" and with what follows in
web.config:

<profile><properties>
<add name="myCart" serializeAs="Binary" type="mai.eCommerce.elist"/>
</properties></profile>

After that, i executed it again without the attribute
"<Serializable()>" and without "serializeAs="Binary" from web.config.

I couldn't notice any difference (nor in table 'Profiles', nor in the
table 'Orders' where the orders are put, nor in the shopping cart, nor
in speed nor in cache, nor in CPU ..).

So my question is:
------------------
what happens (physically on the client/server computer) in this present
application when using serialization what not (physically) happens when
not using it?

Thanks
Casper

<Serializable()_
Public Class listitem
Private _description As String

Public Sub New()
End Sub

Public Property description() As String
Get
Return _description
End Get
Set(ByVal value As String)
_description = value
End Set
End Property
End Class
'--------------------------
<Serializable()_
Public Class elist
....
Public Sub New()
_items = New List(Of listitem)
End Sub
.....
Public Sub Insert(ByVal Price As Decimal, ByVal description As String)
....
End Class



Mar 20 '07 #7
Hi again.
I thought about your answers this (long) night, and maybe you will conclude
i will never understand it ...
but what's then the difference in my application between using
<serialisation_ and not using it? In both cases, data comes into the sql
server table and in both cases, data are retrieved when needed.I tested it.
Is the difference the way data is put (and retrieved) into (from) the table
(with serialization: binary stream, without:?) Or is the attribute
<serialisation_ just ignored when using Profiles, or ...?

In other words, why should i use <serialisation_ if it also works without
it?
Thanks
Mar 21 '07 #8
Casper,

The word serialization is if you build your own class.

If the class is already serializable than there is no need to do something
extra.

Cor

"Casper" <;cd***@px.xfgfgschreef in bericht
news:OU**************@TK2MSFTNGP04.phx.gbl...
Hi again.
I thought about your answers this (long) night, and maybe you will
conclude i will never understand it ...
but what's then the difference in my application between using
<serialisation_ and not using it? In both cases, data comes into the sql
server table and in both cases, data are retrieved when needed.I tested
it.
Is the difference the way data is put (and retrieved) into (from) the
table (with serialization: binary stream, without:?) Or is the attribute
<serialisation_ just ignored when using Profiles, or ...?

In other words, why should i use <serialisation_ if it also works
without it?
Thanks


Mar 24 '07 #9

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

Similar topics

2
by: Hasani | last post by:
If I have a base class that is derived from many classes, and I want to make all the classes serializable. Is there a way I can do this from the base class or must I add to every class, even if...
3
by: Skip | last post by:
Hi, I'm new to .NET remoting and there's something I'm having real trouble with. Basically, I'd like to create a component that can act as a server and as a client (can send messages and receive...
14
by: Tiraman :-\) | last post by:
Hi, i have a StreamWriter that hold a System.Net.Sockets.NetwrokStream and the StreamWriter Object Hold An ArrayList which i would like to Serialize And Send it back to the client via the...
11
by: jason | last post by:
we have developed a .NET class library that defines a family of reusable business objects. the class library is developed in C#, and works quite well. one problem, however, is that as more and...
2
by: Evian Spring | last post by:
We are planning on using "SqlServer" mode for our ASP.NET session state. I know for the classes we store in Session that I need to mark them with the SerializableAttribute as described in this...
6
by: V | last post by:
Hi, I am trying to ascertain if Object Serialization (binary or xml) has been improved (new classes, or new ways) from version 1.1 of the .net framework. I pretty much know how to do that in...
3
by: Roy Chastain | last post by:
I have a schema that has been in existence over 1 year. I have been making a few minor modifications to it recently and suddenly the generated C# classes have made a radical change. I have just...
5
by: raj | last post by:
I know what interfaces are and what they used for etc. Today i am learning about serilization. I know to mark the class "serializable" and implement ISerializable interface, and then implement...
0
by: groovyghoul | last post by:
Hi I have the following XML file: =========================================================== <?xml version="1.0" encoding="UTF-16"?> <Policy xmlns="http://tempuri.org/richard.xsd"> <TransType...
8
by: Casper | last post by:
Hi, i read several articles about serialization. I know now that it is a process of converting an object into a stream of data so that it can be is easily transmittable over the network or can...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.