is serialization required for this?

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
 
C

Cowboy \(Gregory A. Beamer\)

I am not familiar with the code in the book, but you should check if the
data is ever sent over a web service anywhere in the application. If so,
serialization becomes much more important, esp. for binary data.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************
 
B

Bart

Hi thanks for replying.

No, there is no webservices. It's just a e-commerce application, which put
the content of the virtual shopping cart in the table Profiles of
ASPNET.mdb.
You know, i have received a lot of theoretical answers about this but never
an explanation for this:

Is serialization required for putting the content of that class into the
table Profiles? 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 ...?

If you could try to explain me this, i would appreciate it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top