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
On 6 Feb 2017, at 20:20, sergio ruiz <sergio.rrd@gmail.com> 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
Got it.. not just a method.. Thanks! On February 6, 2017 at 3:08:37 PM, Sven Van Caekenberghe (sven@stfx.eu) 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
On Tue, Feb 7, 2017 at 4:07 AM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 6 Feb 2017, at 20:20, sergio ruiz <sergio.rrd@gmail.com> 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
participants (3)
-
Ben Coman -
sergio ruiz -
Sven Van Caekenberghe