473,569 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

is serialization required for this?

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><prope rties>
<add name="myCart" serializeAs="Bi nary" type="wrox.eCom merce.elist"/>
</properties></profile>

After that, i executed it again without the attribute "<Serializable( )>" and
without "serializeAs="B inary" 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 <serialisatio n_ 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
<serialisatio n_ 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
Mar 24 '07 #1
2 1052
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!
*************** *************** ***************
"Bart" <b@sdq.dcwrot e in message
news:ej******** ******@TK2MSFTN GP02.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 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><prope rties>
<add name="myCart" serializeAs="Bi nary" type="wrox.eCom merce.elist"/>
</properties></profile>

After that, i executed it again without the attribute "<Serializable( )>"
and without "serializeAs="B inary" 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 <serialisatio n_ 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
<serialisatio n_ 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

Mar 24 '07 #2
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 <serialisatio n_ 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
<serialisatio n_ just ignored when using Profiles, or ...?

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


"Cowboy (Gregory A. Beamer)" <No************ @comcast.netNoS pamMschreef in
bericht news:CA******** *************** ***********@mic rosoft.com...
>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,
serializatio n becomes much more important, esp. for binary data.

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

*************** *************** ***************
Think outside the box!
*************** *************** ***************
"Bart" <b@sdq.dcwrot e in message
news:ej******** ******@TK2MSFTN GP02.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 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><prop erties>
<add name="myCart" serializeAs="Bi nary" type="wrox.eCom merce.elist"/>
</properties></profile>

After that, i executed it again without the attribute "<Serializable( )>"
and without "serializeAs="B inary" 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 <serialisatio n_ 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


Mar 24 '07 #3

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

Similar topics

4
3127
by: Jeff T. | last post by:
Hello, I have an existing set of C# classes that encapsulate our application data. They are in a heirachy with each subclass defining more specific types of data. I would like to serialize these data objects as XML but perserve the relationships in the XML document. For example, if my classes were: public class GenericItem { }
0
1701
by: Alberto Grosso Nicolin | last post by:
We have the following XML schema: there's a root element (Response) with of a single child element (Result). ---------------------------------------------------------------------------------------------- <?xml version="1.0" encoding="utf-8"?> <xs:schema id="TaskRequest" targetNamespace="http://xyz.com/TaskResponse/1.0"...
3
5295
by: scoobydoo | last post by:
Hello, I am trying to implement ICloneable's Clone() function, using Serialization. However, my code causes an exception. I have a class derived from TreeNode called "Node1". In Node1, I have implemented Clone() using serialization. When I call the Clone() function, the following exception is thrown at
2
2501
by: Robert Magnusson | last post by:
Hi all, I have a healthy class defined that happily serializes and deserializes from the underlying XML file. The problem I hit is that, as soon as I add an implicit conversion in any of the classes (I'm converting from my class into OleDbParameter), the deserialization fails. The following is the error displayed when the code fails...
4
7472
by: Brian Keating | last post by:
wonder if anyone can help me here, i've a framework 1.1 dataset which i serialize in framework 1.1 and deserialize in framework 2.0. This is fine, problem is that i want to modify some of the records in framework 2.0 and serialize the data so framework 1.1 can deserialize it and do what it required. Is this possible?
10
4013
by: Uma - Chellasoft | last post by:
Hai, I am new to VB.Net programming, directly doing socket programming. In C, I will be able to map the message arrived in a socket directly to a structure. Is this possible in VB.Net. Can anyone please help me with some sample codings and guidance? Can you also suggest some other news group available for socket programming in VB.Net?
0
2095
by: Abhishek Padmanabh | last post by:
I have been trying out boost's serialization library for the past few days. And I have come across a problem serializing a class that has a reference member. The code is posted as below: #include <iostream> #include <fstream> #include <string> #include <boost/archive/xml_iarchive.hpp>
2
1335
by: Bart | 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 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...
0
6594
by: bharathreddy | last post by:
Before going to that i want to say few thing on serialization : Serialization is the process of converting an object into a form that can be readily transported. For example, you can serialize an object and transport it over the Internet using HTTP between a client and a server. On the other end, deserialization reconstructs the object from the...
1
11061
by: kikisan | last post by:
I am developing a windows service which utilizes the following classes: interface IPersistable; abstract class PersistableObject : IPersistable;
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8119
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.