Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Saving Objects?
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



Report this thread to moderator Post Follow-up to this message
Old Post
Olaf Kapinski
07-29-04 02:08 AM


Re: Saving Objects?
What 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


Report this thread to moderator Post Follow-up to this message
Old Post
Ricardo Birmann
07-29-04 02:08 AM


Re: Saving Objects?
Olaf 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

Report this thread to moderator Post Follow-up to this message
Old Post
Anthony Lander
07-29-04 02:08 AM


Re: Saving Objects?
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.

Report this thread to moderator Post Follow-up to this message
Old Post
M. Roberts
07-29-04 02:08 AM


Re: Saving Objects?
Thank 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.



Report this thread to moderator Post Follow-up to this message
Old Post
Olaf Kapinski
07-29-04 02:08 AM


Re: Saving Objects?
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:

>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/

Report this thread to moderator Post Follow-up to this message
Old Post
Ian Upright
07-29-04 02:08 AM


Re: Saving Objects?
excelent 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/



Report this thread to moderator Post Follow-up to this message
Old Post
Olaf Kapinski
07-29-04 02:08 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Smalltalk archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:27 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.