B
Bart
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 and that the serializable tag before the class makes the class
serializable.
Now i did some tests in order to understand it better, based on a example i
found in the Wrox book "beginning asp.net 2.0".
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="wrox.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 CPU ..).
So my question is:
------------------
Is serialization required for this? Is there no other way to put the
shopping cart content into table Profiles of the database?
With other words: what's the practical difference in this 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 ...?
I thank you in advance
Bart
The (part of) code:
-------------------
<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
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 and that the serializable tag before the class makes the class
serializable.
Now i did some tests in order to understand it better, based on a example i
found in the Wrox book "beginning asp.net 2.0".
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="wrox.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 CPU ..).
So my question is:
------------------
Is serialization required for this? Is there no other way to put the
shopping cart content into table Profiles of the database?
With other words: what's the practical difference in this 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 ...?
I thank you in advance
Bart
The (part of) code:
-------------------
<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