473,746 Members | 2,701 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Design Patterns for C++ Object Serialization/Deserialization ?

Are there any design patterns for object serialization/deserialization
in C++? Where can I find information pertaining to them? Can someone
post some real coding examples please? I have a need to
serialize/deserialize objects that contain data fields and pointer
fields. Furthermore, not all the fields need to be
serialized/deserialized.

Thanks,
Nimmi
Jul 22 '05 #1
12 7230

"Nimmi Srivastav" <ni************ *@yahoo.com> wrote in message
news:8b******** *************** **@posting.goog le.com...
Are there any design patterns for object serialization/deserialization
in C++? Where can I find information pertaining to them? Can someone
post some real coding examples please? I have a need to
serialize/deserialize objects that contain data fields and pointer
fields. Furthermore, not all the fields need to be
serialized/deserialized.


Check out this paper on the Serializer Pattern. It has example code written
in C++:

http://www.riehle.org/computer-scien...-serializer.pd
f

I had to write a serializer several years ago and this paper was a very
useful reference.

Michael Feathers
www.objectmentor.com


Jul 22 '05 #2
Hi try www.boost.org.

I believe they have a working library.
Jul 22 '05 #3
"Michael D. Borghardt" <mi*****@borgha rdtConsulting.n et> wrote:
Hi try www.boost.org.

I believe they have a working library.


*1* example of the EXTENSIVE REUSE that many of the XP naysayers are
either ignorant of, pathologically can't accept because it conflicts
with their nickel and dime, baby step test driven mythological safe
zone, and or opportunistical ly deny for $$$ and fame, "I'm the
alternative" reasons.
"Welcome to Boost.org!

The Boost web site provides free peer-reviewed portable C++ source
libraries. The emphasis is on libraries which work well with the C++
Standard Library. The libraries are intended to be widely useful, and
are in regular use by thousands of programmers across a broad spectrum
of applications.

A further goal is to establish "existing practice" and provide
reference implementations so that Boost libraries are suitable for
eventual standardization . Ten Boost libraries will be included in the
C++ Standards Committee's upcoming C++ Standard Library Technical
Report as a step toward becoming part of a future C++ Standard.

Although Boost was begun by members of the C++ Standards Committee
Library Working Group, participation has expanded to include thousands
programmers from the C++ community at large"
*************** **END EXCERPT

Elliott
--
Not approaching OO as modelling execution
of physical machines, per the creators of OO
is like not having a software engineering soul.
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Jul 22 '05 #4
Universe wrote:
"Michael D. Borghardt" <mi*****@borgha rdtConsulting.n et> wrote:
Hi try www.boost.org.


*1* example of the EXTENSIVE REUSE that many of the XP naysayers are
either ignorant of, pathologically can't accept because it conflicts
with their nickel and dime, baby step test driven mythological safe
zone, and or opportunistical ly deny for $$$ and fame, "I'm the
alternative" reasons.


Eh?...

Perhaps your point could be better conveyed by shorter sentences.

--
Ben M.
Jul 22 '05 #5
On Thu, 27 May 2004 02:34:26 GMT, "Michael D. Borghardt"
<mi*****@borgha rdtConsulting.n et> wrote:
Hi try www.boost.org.


I've heard some very good things about this library. Actually, I have
some C++ work ahead of me, and this post reminded me about Boost. I
look forward to using it.

-----
Robert C. Martin (Uncle Bob)
Object Mentor Inc.
unclebob @ objectmentor . com
800-338-6716

"The aim of science is not to open the door to infinite wisdom,
but to set a limit to infinite error."
-- Bertolt Brecht, Life of Galileo
Jul 22 '05 #6
On Wed, 26 May 2004 22:57:52 -0400, Universe
<un******@tAkEc ovadOuT.net> wrote:

"Welcome to Boost.org!


What was all that? An advertisement?

--
Al Balmer
Balmer Consulting
re************* ***********@att .net
Jul 22 '05 #7

"Michael D. Borghardt" <mi*****@borgha rdtConsulting.n et> wrote
Hi try www.boost.org.

I believe they have a working library.

The library resides currently at:
http://www.rrsd.com/boost/index.htm

It covers very wide range of serialization options
and was ported on number of platforms (BCB port is underway).

/Pavel

Jul 22 '05 #8
Universe wrote:
"Michael D. Borghardt" <mi*****@borgha rdtConsulting.n et> wrote:

Hi try www.boost.org.

I believe they have a working library.

*1* example of the EXTENSIVE REUSE that many of the XP naysayers are
either ignorant of, pathologically can't accept because it conflicts
with their nickel and dime, baby step test driven mythological safe
zone, and or opportunistical ly deny for $$$ and fame, "I'm the
alternative" reasons.


[snip stuff]

Lots of words but few links. Can you be so kind as to point out the
serialization library? I can't find it at
<http://www.boost.org/libs/libraries.htm>

-Peter
Jul 22 '05 #9
Peter Ammon wrote:
Universe wrote:
"Michael D. Borghardt" <mi*****@borgha rdtConsulting.n et> wrote:

Hi try www.boost.org.

I believe they have a working library.

*1* example of the EXTENSIVE REUSE that many of the XP naysayers are
either ignorant of, pathologically can't accept because it conflicts
with their nickel and dime, baby step test driven mythological safe
zone, and or opportunistical ly deny for $$$ and fame, "I'm the
alternative" reasons.

[snip stuff]

Lots of words but few links. Can you be so kind as to point out the
serialization library? I can't find it at
<http://www.boost.org/libs/libraries.htm>

-Peter


Never mind, someone else pointed it out. It wasn't on the libraries
page because it hasn't been accepted into Boost yet.
Jul 22 '05 #10

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

Similar topics

2
3825
by: Snowman | last post by:
Suppose I have a RootObject which holds a collection of other objects. The other objects have a property (Parent) which refers back to the "parent" collection (b.t.w. my collection is based on CollectionBase), in similar fashion as the object models of MS Office. I want to serialize this object graph (with RootObject as the xml document element) without Parent property serialized, this may be done by adding XmlIgnoreAttribute on the...
7
9557
by: schoenfeld1 | last post by:
I've implemented IPC between two applications using named pipes and binary serialization, but have noticed that the binary formatter is rather slow. It seems that the binary formatter reflects the entire type everytime it is invoked to serialize/deserialize an object of that type. Is there a way to prepare the binary formatter with a pre-defined type, such that it only reflects once but can be re-used to serialize/deserialize objects...
3
1804
by: umbertoeklat | last post by:
as a proof of concept, am trying create a web app w/ an XML file as a temp DB What is the fastest way to do serialization/deserialization? or maybe the better question would be how to efficiently retrieve/save data to an xml file. have tried deserializing from XML file but having a hard time on mulitple records...
8
3467
by: ashoksrini | last post by:
Hi All, I have the below requirement and would like to get some feeback from the group on the best way to implement: 1. I have WSDL defined exposing few web services. 2. We dont have a requirement to have a server web service class. (reasons below) 3. I want to develop something like this - when client makes a web service call, on the server I can intercept the SOAP message (XML doc itself),
5
2523
by: Hans-Jürgen Philippi | last post by:
Hi Group, I've defined a class with an 'ID' property, which is a GUID that is created at the time of the very first object instance creation. This member is not included when I serialize an object instance to XML, since it is read-only. Actually, I want to preserve the ID value with serialization/deserialization processes but I do *not* want it to be writeable from code by a simple myObject.ID = ... assignment - how to achieve this? ...
11
3687
by: William | last post by:
I'm looking for an example that would show how to serialize a c++ object at it's simplest w/o using any other api's. I have a class that I want to serialize and then pass to my obj-c class so I can send it over the wire. I'm just looking for how to serialize it, then pack it back up on the other end. Any help much appreciated.
6
1968
by: abcd | last post by:
I have 13 yrs experience working from Visual Studio 1.x today VS 2005 (both VB and C++) Most of the time I have worked in N-tier applications, Web applications, Windows applications....My company is a small company very limited budget..We have enterprise web products written in VB/VC++, class ASP. We have not even used .NET etc. Lots of people are talking about Design patterns, standard architecture (SOS or other IBM). I am very...
0
11625
weaknessforcats
by: weaknessforcats | last post by:
Design Patterns: Visitor Introduction Polymorphism requires a class hierarchy where the interface to the hierarchy is in the base class. Virtual functions allow derived classes to override base class functions. Applications using polymorphism typically have functions with base class pointers or references as arguments. Then derived objects are created and used as arguments to these functions. Inside the function, only the base class methods...
4
1798
by: Anonymous | last post by:
I am looking for design patterns implemented in C++ for the following purposes: 1). Study and learn from the code 2). Avoid reinventing the wheel Searches on google are annoyingly turning up Java and C# examples - EVEN when I specify C++ in search. I *could* 'port' from either language to C++, but it defeats the purpose i stated earlier.
0
8800
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9500
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9349
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9285
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9218
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6772
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6060
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4836
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3292
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

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.