[Newbies] Re: Sharing a Singleton for read-only access to data
stephan at stack.nl
Fri May 13 05:44:30 UTC 2016
Just a small flaw, easy to fix.
You can just subclass the session class and add the filter data to that,
or you can add user management.
In QcMagritte we use announcements and user management, so there
WASession subclass: #QCSession
instanceVariableNames: 'announcer user'
with methods like
^self user notNil
where the seaside application class (class side) does
^(WAAdmin register: self asApplicationAt: anApplicationName)
preferenceAt: #sessionClass put: self sessionClass;
and the seaside component does
^self session isLoggedIn
If you want the filters to be coupled to the user instead of the
session, your users can also be such a singleton collection.
Otherwise, just use a session class that holds onto your filter data.
Seaside itself (on Squeak and Pharo) is threadsafe
More information about the Beginners