Exactly. To everyone who thinks @ApplicationState is not a misleading term, I would ask you to think back to when you started with T5. Are you sure you didn't think @ApplicationState meant application-wide scope? When I see @ApplicationState today I still do a momentary double-take before I remind myself that only services have application- wide scope.

Of course, it would be possible to persist an ASO in a way that achieves application-wide scope, but who has ever done it and why would you?

Lubor's suggestion in an earlier thread is compelling - remove all confusion by replacing @Persist and @ApplicationState with @Scope:

@Scope(FLASH)
@Scope(PAGE)
@Scope(CONVERSATION)
@Scope(SESSION)
@Scope(APPLICATION)

I think it deserves serious consideration, don't you?

Geoff

On 18/09/2008, at 1:08 AM, Peter Stavrinides wrote:

ApplicationStateObject is a misnomer, it also got me when I started T5, what it really is, is a session scoped object (1 per user, per session), by default Tapestry services that use the @Inject annotation are singletons (1 per application) as apposed to the @ApplicationState annotation




----- Original Message -----
From: "Maximilian Weißböck" <[EMAIL PROTECTED]>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Wednesday, 17 September, 2008 5:52:26 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul
Subject: AW: T5: ApplicationStateObject is misleading



-----Ursprüngliche Nachricht-----
Von: Kristian Marinkovic [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 16. September 2008 15:19
An: Tapestry users
Betreff: Re: T5: ApplicationStateObject is misleading
....

I'm no native speaker but ApplicationStateObject is quite fine for
me... it means to me, that there is one object somewhere (instance)
that is the same in the whole application.

g,
kris


Now I'm really confused - and that is the problem Geoff is talking
about ;-)

Is an ApplicationStateObject an Object that is global for the whole
Application and thus the same for every user/Session? Thats what I
would expect from the name.

Or is it globaly accessibl in the application, but different for each
Session - than I would expec an Name like SessionStateObject.

So what is it really?

Thanks, Max



Hi Geoff,

I absolutely agree with you that concept of ASO objects and persistent properties is one of few downsides of current Tapestry implementation. I came across this type of problems recently when I was experimenting with
Tapestry & Spring Web Flow integration.

One of the issues that I had to solve was to find simple solution how from
tapestry pages access objects stored in different webflow scopes. To
achieve
this goal I couldn't use neither persistent properties nor ASO. Persisted properties can't be shared between different pages in the same flow and
ASO
objects require additional configuration if you want to use non default persistence strategy (to complicated solution). Therefore I was forced to
develop my own solution which is based on my custom ScopeWorker that
allows
page properties to be annotated by my custom @Scope annotation:

public class MyPage {

  @Scope(SESSION)
  private User user;

  @Scope(FLOW)
  private Facility facility;

  ...

}

@Scope annotation can be used with different scope types (APPLICATION, SESSION, CONVERSATION, FLOW, FLASH, PAGE, REQUEST, etc.) to access objects
stored in these scopes (when object is not found in the scope it's
automatically created).

I think that it would be good idea to find (in some future Tapestry
release)
simple generic solution for scoping page properties that would replace
currently used ASO and Persist strategies (these could be marked as
obsolete
and kept for backward compatibility reasons).

Regards
Lubor


On Tue, Sep 16, 2008 at 12:49 PM, Inge Solvoll
<[EMAIL PROTECTED]>wrote:

I agree, I've always found the term "ApplicationState" to be a bit
confusing.

Some more ideas:

@UserState
@SessionState
@SessionPersist
@SaveItForLater (kidding)

On Tue, Sep 16, 2008 at 1:06 PM, Geoff Callender <
[EMAIL PROTECTED]> wrote:

We want Tapestry to be as natural as possible for newcomers, so it's important to have terminology that is not misleading. Right now might
be
the
last chance to tidy some of these up before T5.0 goes final.

One term that I believe many people find misleading is
ApplicationState.
The problem is that it implies it will make an object available
across
the
whole application, ie. application-scoped; which is not its purpose.

The doco says that ASOs "are unique to an individual user, not shared
between users", which is not quite right, either.

The standard usage is to tie an object's scope to that of a web
session,
so
maybe we should put "session" in the name? Eg.

      @SessionScoped
      @SessionShared
      @ShareAcrossSession

It is important to understand that the term "session" here is NOT a
reference to the persistence mechanism, but a reference to the scope.

Alternatively, let's keep it really obvious with this:

      @StateObject

with the understanding that the default persistence strategy is
"session".

What do others think?  Are you happy with ApplicationState?

Geoff



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to