Yes, the _method_ apply sticks around. I think I said that pretty explicitly, but just to reiterate:

Your typical use will be:

<state applied="${some constraint}">...<state>

or:

<state name="mystate">...</state>
...
mystate.apply();
...
mystate.remove();

or, equivalently:

<state name="mystate">...</state>
...
mystate.setAttribute('applied', true);
...
mystate.setAttribute('applied', false);

For 4.1 the _attribute_ apply will still work, but you will get a deprecated warning in debug mode.

And I filed a bug to amend the 4.x updater script to do this renaming.

I think the constraint is much more likely to be the common usage pattern. Eventually, we should also discourage the use of the apply and remove methods, IMO, and encourage the use of setAttribute. That would be more consistent the our other API's.

On 2008-05-15, at 11:25 EDT, David Temkin wrote:

Sounds good, but the method "apply" sticks around, right? That, I think, is and will be the more typical way of controlling a state.

On May 14, 2008, at 4:54 PM, Henry Minsky wrote:

I endorse this proposal.




On Wed, May 14, 2008 at 7:23 PM, P T Withington <[EMAIL PROTECTED]> wrote: We need to clean up the API for states. Right now states have both an attribute _and_ a method named `apply`. This just makes no sense. It is implemented by a horrendous kludge that we will not be able to carry forward into Javascript 2 runtimes. Here's my proposal:

1) Deprecate `apply` the attribute. Replace it with `applied`, which is a read/write attribute whose value reflects whether or not the state is currently applied. (There is currently a property `isapplied` that is read-only that tells the state of a state, but this name is inconsistent with our name conventions. As a part of this proposal, deprecate `isapplied` and replace it with `applied`.

The `apply` method (and it's counterpart `remove`) remain, but the preferred method for controlling a state is to constrain the `applied` property.

We can add to the 4.x upgrade script a template that looks for `apply` in the open tag of a state and replaces it with `applied`.

Comments?



--
Henry Minsky
Software Architect
[EMAIL PROTECTED]



Reply via email to