Code Comments
Programming Forum and web based access to our favorite programming groups.Hi! I'm just starting with SmallTalk, Visual Works 7.2. Try the following: Build a Datacollection-Object which contains two Dirtionaries an some other Variables. The Dictionaties will store lots of other Object. So far no Problem. But how can I save the Datacollection Object to Disc? Thanks a lot! OLAF
Post Follow-up to this messageWhat exactly do you need??
If you want to create a database you could use PostgreSQL, but I have
never used it so I am not familiar with it. Anyway, from what I
understood from your post, that's not what you're looking for; if all
you want is to save a copy of the curent state of an object to disk,
you should use BOSS files. After loading the parcel BOSS, the following
code can be used to save a file:
str := ('pathToFileName' asFilename) writeStream.
(BinaryObjectStorage onNew: str) nextPut: yourObject.
str flush.
To load it back, use:
str := ('pathToFileName' asFilename) readStream.
aBOSSObject := ((BinaryObjectStorage onOld: str) contents).
yourObject := aBOSSObject at: 1.
hope it helps,
Ricardo
Post Follow-up to this messageOlaf Kapinski wrote: > Try the following: Build a Datacollection-Object which contains two > Dirtionaries an some other Variables. The Dictionaties will store lots of > other Object. So far no Problem. But how can I save the Datacollection > Object to Disc? Make sure the BOSS parcel is loaded, then: | boss fileStream | fileStream := 'objects.boss' filename asFilename writeStream. boss := BinaryObjectStorage onNew: fileStream. boss nextPut: yourObject. boss close. Then to read it back: | boss fileStream | fileStream := 'objects.boss' filename asFilename readStream. boss := BinaryObjectStorage onOld: fileStream. yourObject := boss next. boss close. Best regards, -anthony
Post Follow-up to this messageOlaf, As others have mentioned, the simplest solution is to use BOSS. Documentation can be found in the Application Developer's Guide. If you want more sophisticated functionality, like an object database, you might consider OmniBase. HTH, M. Roberts Cincom Systems, Inc.
Post Follow-up to this messageThank you two for the Answers! A little bit more exact: I created an Object, containing 2 Dictionaries. One of the Dictionaries will contain Objects of the created Class "IT-Application" and the other of "IT-Systems". Over the time I will fill the Datastore-Object with datas an need to store ist (don't want to type in all my Systems an Applications on every Start of the Tool 8-) ). I will try the BOSS-tips. Are there any easy (!) possibilities to store such a complex Object into an XML-File. No Pproblem, if not but would be nice. Thanks a lot!!!! OLAF "M. Roberts" <mroberts@cincom.com> schrieb im Newsbeitrag news:5b70f568.0407262232.1666e584@posting.google.com... > Olaf, > > As others have mentioned, the simplest solution is to use BOSS. > > Documentation can be found in the Application Developer's Guide. > > If you want more sophisticated functionality, like an object database, you > might consider OmniBase. > > HTH, > > M. Roberts > Cincom Systems, Inc.
Post Follow-up to this messageHave a look for a recent announcement in this newsgroup about SIXX, which does exactly that -- serialization of objects using XML. Ian "Olaf Kapinski" <OK@ps.cox> wrote: >Thank you two for the Answers! > >A little bit more exact: I created an Object, containing 2 Dictionaries. On e >of the Dictionaries will contain Objects of the created Class >"IT-Application" and the other of "IT-Systems". Over the time I will fill >the Datastore-Object with datas an need to store ist (don't want to type in >all my Systems an Applications on every Start of the Tool 8-) ). > >I will try the BOSS-tips. Are there any easy (!) possibilities to store suc h >a complex Object into an XML-File. No Pproblem, if not but would be nice. > >Thanks a lot!!!! > >OLAF --- http://www.upright.net/ian/
Post Follow-up to this messageexcelent Hint, thanks a lot! (I didn't expected so much feedback in a SmallTalk Newsgroup. Thought, that Language was nearly dead...) Best regards to all! OLAF "Ian Upright" <ian-news@upright.net> schrieb im Newsbeitrag news:2vvbg09bk6bq0nl9or0ad0dmnp050fqivt@ 4ax.com... > Have a look for a recent announcement in this newsgroup about SIXX, which > does exactly that -- serialization of objects using XML. > > Ian > > "Olaf Kapinski" <OK@ps.cox> wrote: > One in such > > --- > http://www.upright.net/ian/
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.