[Seaside] Session accesible from the model of an application

John Thornborrow john at pinesoft.co.uk
Wed Apr 18 10:37:02 UTC 2007


Göran Krampe wrote:
> Hi!
>
>   
>> Hi Sebastian, I have pondered this question for reaching my Magma
>> session from my domain without diectly referencing them.
>>
>>   http://wiki.squeak.org/squeak/5605
>>
>> 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
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>  
>
>   
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:

instance
    ^Session ifNil:
         [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 mailing list