Persisting data in the Image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Persisting data in the Image

sergio_101
Is it enough to create a collection on a class to persist data and keep it away from the GC?

something like:

class Person>>people
^ <an ordered collection of people>

where add: and remove: would remove them from the collection..



----
peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.Village-Buzz.com
http://www.ThoseOptimizeGuys.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101

signature.asc (852 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Persisting data in the Image

Sven Van Caekenberghe-2

> On 6 Feb 2017, at 20:20, sergio ruiz <[hidden email]> wrote:
>
> Is it enough to create a collection on a class to persist data and keep it away from the GC?
>
> something like:
>
> class Person>>people
> ^ <an ordered collection of people>
>
> where add: and remove: would remove them from the collection..

You need to put the collection in a class variable (or in some global variable).

> ----
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.Village-Buzz.com
> http://www.ThoseOptimizeGuys.com
> http://www.coffee-black.com
> http://www.painlessfrugality.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101


Reply | Threaded
Open this post in threaded view
|

Re: Persisting data in the Image

sergio_101
Got it.. not just a method..

Thanks!


On February 6, 2017 at 3:08:37 PM, Sven Van Caekenberghe ([hidden email]) wrote:

You need to put the collection in a class variable (or in some global variable). 
----
peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.Village-Buzz.com
http://www.ThoseOptimizeGuys.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101

signature.asc (852 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Persisting data in the Image

Ben Coman
In reply to this post by Sven Van Caekenberghe-2
On Tue, Feb 7, 2017 at 4:07 AM, Sven Van Caekenberghe <[hidden email]> wrote:

>
>
> > On 6 Feb 2017, at 20:20, sergio ruiz <[hidden email]> wrote:
> >
> > Is it enough to create a collection on a class to persist data and keep it away from the GC?
> >
> > something like:
> >
> > class Person>>people
> >       ^ <an ordered collection of people>
> >
> > where add: and remove: would remove them from the collection..
>
> You need to put the collection in a class variable (or in some global variable).
>
>

You may also find these interesting...
http://onsmalltalk.com/simple-image-based-persistence-in-squeak/
http://smalltalkhub.com/#!/~TorstenBergmann/SimplePersistence
cheers -ben