Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 

Go Back   XSL - XML - RSS Forums > XML General > .NET and XML

Tags:



Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-04-2008, 07:09 PM
Vadim Rapp
 
Posts: n/a

Default How to make an object to survive application restart?



My application in vb.net is using a collection of structures, implementing
basically a queue of jobs. What is the easiest way to make this collection
surviving application restart? Is there some embedded universal way to save
each member of the collection, for example to an XML file, and then restore
them upon restart? I understand that I can code the export of every
particular object, but thought maybe there's some universal way like
object.ExportToXML <path> / object = loader.load <path>

thanks


Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-04-2008, 09:11 PM
Family Tree Mike
 
Posts: n/a

Default Re: How to make an object to survive application restart?



"DH" wrote:

> Vadim Rapp wrote:
> > My application in vb.net is using a collection of structures, implementing
> > basically a queue of jobs. What is the easiest way to make this collection
> > surviving application restart? Is there some embedded universal way to save
> > each member of the collection, for example to an XML file, and then restore
> > them upon restart? I understand that I can code the export of every
> > particular object, but thought maybe there's some universal way like
> > object.ExportToXML <path> / object = loader.load <path>
> >
> > thanks
> >
> >

> Vadim, try a vb newsgroup this is C#
>


It was cross posted from vb, but I don't know why based on the question...


Reply With Quote
  #3 (permalink)  
Old 12-05-2008, 12:42 PM
Phill W.
 
Posts: n/a

Default Re: How to make an object to survive application restart?

Vadim Rapp wrote:

> My application in vb.net is using a collection of structures, implementing
> basically a queue of jobs. What is the easiest way to make this collection
> surviving application restart?


Write them to files.

(Actually, is there any particular reason you don't /keep/ them in
files/directories anyway? This would be much more resilient for those
"odd" occasions where your application or the machine it's running on,
suddenly "disappears" for some strange reason).

> Is there some embedded universal way to save each member of the collection,
> for example to an XML file, and then restore them upon restart?


That sounds like Serialisation which /should/ work, just so long as
every Type that you're working with is marked as Serializable.
If just /one/ Class isn't marked that way, then your Save mechanism will
break.

> I understand that I can code the export of every particular object,


.... and that's a Good Thing, because you have complete control over what
gets saved and how you choose to read it back again ...

> but thought maybe there's some universal way like
> object.ExportToXML <path> / object = loader.load <path>


Even if there were such a method, every object is different and you'd
probably wind up overriding the default implementation anyway.

HTH,
Phill W.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Contact Us -|- XSL - XML - RSS Forums -|- Archive -|- Top -|-Rules/Disclaimer-|-Help/Support -|-Advertise
© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
All times are GMT. The time now is 05:16 PM.
Style Developed by Epic Designz