[aida] Aida application instance data
janko.mivsek at eranova.si
Tue Feb 5 20:06:19 CET 2008
Rob Rothwell wrote:
> Can anyone help me understand where to store data specific to that
> instance of the application? For example, if I use the in-place editor
> [ajax] demo on one computer and then I open the same page from another
> computer, I see what you typed on the first computer. If I type
> something new and refresh the page on the first computer, I get the same
> result. What I WANT to see is "private" data for that page.
Besides domain objects which are accessible by any user, any session (if
security allows) you have the instances of an App, one per each session
per domain object. You can put session specific (temporary!) data here.
Temporary because this state is usually cleared, each night for
instance. But you can use WebSession userValues or WebUser userValues
for permanent session/user specific data.
> When I experiment with the session object, I find the same results...a
> session seems to be shared across all instances of the application.
Session is shared only among App instances for different domain objects.
But you have never more than one app instance for the same domain object
per session. That's obvious if you know the rule: a new App instances
for every new session, per domain object. So if you have say 10 domain
objects and 10 session, you have up to 100 App objects, one for each
session:domain object combination.
> Maybe what I don't really understand is:
> (AIDASite named: 'aidaOn8888') urlResolver defaultURL: '/mypage.html'
> forObject: myobj.
> I am assuming there is only ever one instance of myobj created (not
> multiple objects for each request), so where can I create/store a NEW
> object, and is there a method called in my application when a new
> instance is requested so that I can initialize that object?
> Does this make sense? I think I don't understand something basic,
> because it seems that every "page" (from either multiple browsers or
> multiple computers) should have it's own object space.
Let we look at Aida tutorial: AddressBook with Addresses. That's a
domain model with anAddressBook as root domain object. Is your question
(translated to a tutorial case) how to add a new address to address book?
Smalltalk Web Application Server
More information about the Aida