How to save Object Instances in text File ?
Author |
Message |
m.. #1 / 7
|
 How to save Object Instances in text File ?
-- Hello, I am looking for something, like a powerfull customized BOSS, which permits to save and load a collection of Object Instances, under string or textual forms, with class, class variable and instance variable names and their instance values, readable with standard editors outside Smalltalk (?). Certainly, something like this exist already, but I do not know where or inside which categories and methods, perhaps near FileIN and FileOut, or may be within the BOSS possibilities ? Thank you for any helpfull advice or more detailled answers. Regards. Marc ==============================================================
|
Fri, 18 Jul 1997 00:32:05 GMT |
|
 |
Vadim Sokolovs #2 / 7
|
 How to save Object Instances in text File ?
Quote: > Hello, > I am looking for something, like a powerfull customized BOSS, which permits > to save and load a collection of Object Instances, under string or textual forms, > with class, class variable and instance variable names and their instance values, > readable with standard editors outside smalltalk (?). > Certainly, something like this exist already, but I do not know where or inside > which categories and methods, perhaps near FileIN and FileOut, or may be within > the BOSS possibilities ? > Thank you for any helpfull advice or more detailled answers. > Regards. > Marc
Mark, The Smalltalk messages storeOn: and readFrom: (which are defined for Object) will do it. The problem, however, is that you will not be able to strip out the compiler, since these methods require it's presence. Some classes (Date, Time, etc.) override these messages and do not requre the compiler presence, and you can define these methods for your own classes. Hope it helps Regards,' Vadim Sokolovsky GreenPoint, Inc
|
Sat, 19 Jul 1997 01:18:34 GMT |
|
 |
Jimmy Nguy #3 / 7
|
 How to save Object Instances in text File ?
Quote:
>I am looking for something, like a powerfull customized BOSS, which permits >to save and load a collection of Object Instances, under string or textual forms, >with class, class variable and instance variable names and their instance values, >readable with standard editors outside smalltalk (?).
You may want to try using #storeOn:, or #storeString. Most basic Smalltalk objects knows how to generate its own storeString. Of course, circular objects can result in infinite loop in generating the storeString. Also, you will need the Smalltalk compiler to compile the storeString to get back an equivalent object (that generated the storeString.) Jimmy Nguyen "Speak for no entity - not even myself. I just babble..."
|
Sat, 19 Jul 1997 22:32:50 GMT |
|
 |
Bj?rn Eiderb? #4 / 7
|
 How to save Object Instances in text File ?
Quote:
> writes: > I am looking for something, like a powerfull customized BOSS, which permits > to save and load a collection of Object Instances, under string or textual forms > , > with class, class variable and instance variable names and their instance values > , > readable with standard editors outside smalltalk (?). > Certainly, something like this exist already, but I do not know where or inside > which categories and methods, perhaps near FileIN and FileOut, or may be within > the BOSS possibilities ? > Thank you for any helpfull advice or more detailled answers.
Look at the methods storeOn: respectively readFrom:! There are a lot of classes that redefines at least one of these messages; e.g. Date, Time, Array, Image, Message and String. Also look at the "default behavior" in the class Object (storeOn:) and its metaclass (readFrom:). By looking at these "examples" you should easily get what you want! Regards, Bjorn Eiderback ---
THE ROYAL INSTITUTE OF TECHNOLOGY voice: +46 (8) 790 6277 Department of Numerical Analysis fax: +46 (8) 102477, 7900930 and Computing Science Osquars backe 2 S-100 44 Stockholm Sweden ---
|
Sun, 20 Jul 1997 00:49:22 GMT |
|
 |
macgr.. #5 / 7
|
 How to save Object Instances in text File ?
Quote: > I am looking for something, like a powerfull customized BOSS, which permits > to save and load a collection of Object Instances,
There's something called objectfiler in ST/V, from a brief look at the readme notes it may do what you want (its in the extras direrctory).
|
Sun, 20 Jul 1997 20:26:29 GMT |
|
 |
m.. #6 / 7
|
 How to save Object Instances in text File ?
Hello, Thank you very much for the answers about my problem, ... Looking for a solution with "ObjectFiler", for instance, I have not found from Where I could retrieve "ObjectFiler" and I do not know if it could be allright for me ? I am working under Smalltalk 80, Park Place - Visual Works release 4.1, not under ST_V. Regards, Marc. ==============================================================
|
Mon, 21 Jul 1997 20:09:18 GMT |
|
|
|