ReStore singleton question

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

ReStore singleton question

Bruno Brasesco
Hi,

Which is the best way to use a singlenton with ReStore ?.

I have a singleton (Stock current) and it is referenced in a lot of
methods along the system:

DomainObject
currentStock
        ^Stock current

With ReStore a have to store "Stock current" in the db.

Which is the best way to implement this in ReStore?
(and i can have more than one ReStore session at the same time)

regards bruno


Reply | Threaded
Open this post in threaded view
|

Re: ReStore singleton question

Bruno Brasesco
Solution,

DomainObject
currentStock
        ^Stock currentStockOn: self reStore
reStore
        ^self server sessionFor: self

Stock
currentStockOn: aSSWReStore
        ^(aSSWReStore instancesOf: Stock) asOrderedCollection last


regards bruno