[Seaside] Session accesible from the model of an application
john at pinesoft.co.uk
Wed Apr 18 10:37:02 UTC 2007
Göran Krampe wrote:
>> Hi Sebastian, I have pondered this question for reaching my Magma
>> session from my domain without diectly referencing them.
>> The ideas may translate to Seaside or other "sessions"..
> Just a note - in Gjallar we use DynamicBindings for this. So deep in the
> domain model we can type "Q2Session current" (a subclass of WASession
> which in turn holds a MagmaSession) and then do what we like with it.
> A simpler approach avoiding DynamicBindings would be using the pattern
> that is used in Seaside itself (or Pier) by subclassing Notifier etc.
> Or did I misunderstand the question?
> In Gjallar we fire off Magma transactions deep inside the domain model -
> due to the design of Gjallar where we package all db modifications in
> Q2Txn objects thus saving an endless history of all deltas (similar to
> Prevayler etc).
> regards, Göran
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
Try implementing a Registry (see "Registry Pattern") and if you are
using magma in single-user mode, implement a singleton on the magma
session. I opted to subclass MagmaSession and provide an #instance method:
[Session _ (MagmaSession openLocal: '/path') connectAs: 'user']
Pinesoft Computers are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA
This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
More information about the Seaside