Gaetan de Menten | 7 Oct 17:49

Class instances in statics not supported in 0.8?

Are class instances in statics not supported in 0.8 anymore?

qx.locale.Manager is undefined    DateFormat.js (line 47)
    this.__locale = qx.locale.Manager.getInstance().getLocale();

See attached test script (which worked fine in 0.7).

PS: Since I don't know whether this is a bug or simply a pattern which
is not supported anymore, I'm posting here and not in the bugtracker
directly.

--

-- 
Gaëtan de Menten
http://openhex.org
Attachment (Application.js): application/x-javascript, 465 bytes
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Gaetan de Menten | 7 Oct 17:55

Fwd: Class instances in statics not supported in 0.8?

Resending with testcase renamed to bypass stupid filter...

---------- Forwarded message ----------
From: Gaetan de Menten <gdementen <at> gmail.com>
Date: Tue, Oct 7, 2008 at 5:50 PM
Subject: Class instances in statics not supported in 0.8?
To: qooxdoo Development <qooxdoo-devel <at> lists.sourceforge.net>

Are class instances in statics not supported in 0.8 anymore?

qx.locale.Manager is undefined    DateFormat.js (line 47)
   this.__locale = qx.locale.Manager.getInstance().getLocale();

See attached test script (which worked fine in 0.7).

PS: Since I don't know whether this is a bug or simply a pattern which
is not supported anymore, I'm posting here and not in the bugtracker
directly.

--

-- 
Gaëtan de Menten
http://openhex.org
qx.Class.define("testqx.Application",
{
  extend : qx.application.Standalone,

  statics: {
    ISO_8601_FORMAT: new qx.util.format.DateFormat("yyyy-MM-dd")
(Continue reading)

thron7 | 8 Oct 09:21

Re: Fwd: Class instances in statics not supported in 0.8?

Hi Gaetan,

this is just a quick reply to confirm that the behaviour has indeed 
changed between 0.7 and 0.8 - and not intentionally. But there are some 
strange phenomena involved so we need to look into it further. If you 
could open a bug for it, adding your Application.js, that would be awesome.

BTW: Your Application.js went through with the first mail, at least for 
me...!?

Thomas

Gaetan de Menten wrote:
> Resending with testcase renamed to bypass stupid filter...
>
> ---------- Forwarded message ----------
> From: Gaetan de Menten <gdementen <at> gmail.com>
> Date: Tue, Oct 7, 2008 at 5:50 PM
> Subject: Class instances in statics not supported in 0.8?
> To: qooxdoo Development <qooxdoo-devel <at> lists.sourceforge.net>
>
>
> Are class instances in statics not supported in 0.8 anymore?
>
> qx.locale.Manager is undefined    DateFormat.js (line 47)
>    this.__locale = qx.locale.Manager.getInstance().getLocale();
>
> See attached test script (which worked fine in 0.7).
>
> PS: Since I don't know whether this is a bug or simply a pattern which
(Continue reading)

Gaetan de Menten | 8 Oct 09:41

Re: Fwd: Class instances in statics not supported in 0.8?

On Wed, Oct 8, 2008 at 9:21 AM, thron7 <thron7 <at> users.sourceforge.net> wrote:

> this is just a quick reply to confirm that the behaviour has indeed
> changed between 0.7 and 0.8 - and not intentionally. But there are some
> strange phenomena involved so we need to look into it further. If you
> could open a bug for it, adding your Application.js, that would be awesome.

Done.
http://bugzilla.qooxdoo.org/show_bug.cgi?id=1455

> BTW: Your Application.js went through with the first mail, at least for
> me...!?

Duh... Probably a problem at sourceforge then... I received the
following message:

from	Administrator <Administrator <at> do.not.reply>
subject	[MailServer Notification]Attachment Blocking Notification

ABGZE77E: Warning to Sender: An attachment to your message has been
blocked by Fujitsu Siemens mail system due to the file type. The file may
be deliverable if zipped.

Message details:
Sender: ...
Recipient:qooxdoo-devel <at> lists.sourceforge.net;
Subject:[qooxdoo-devel] Class instances in statics not supported in 0.8?

Attachment name:Application.js

(Continue reading)

thron7 | 8 Oct 10:53

Re: Fwd: Class instances in statics not supported in 0.8?


Gaetan de Menten wrote:
> On Wed, Oct 8, 2008 at 9:21 AM, thron7 <thron7 <at> users.sourceforge.net> wrote:
>
>   
>> this is just a quick reply to confirm that the behaviour has indeed
>> changed between 0.7 and 0.8 - and not intentionally. But there are some
>> strange phenomena involved so we need to look into it further. If you
>> could open a bug for it, adding your Application.js, that would be awesome.
>>     
>
> Done.
> http://bugzilla.qooxdoo.org/show_bug.cgi?id=1455
>
>   

Great. As a quick workaround, to get your code going, you could add the 
following compiler hints to your Application.js:

/*
#require(qx.locale.Manager)
#require(qx.locale.Date)
*/

This is of course awful, since you are fixing missing dependencies for 
the DateFormat class, but this is how you can treat it in your own code. 
The generator should do this correctly, but it is not so obvious how to 
achieve this.

> Duh... Probably a problem at sourceforge then... I received the
(Continue reading)

Gaetan de Menten | 8 Oct 11:10

Re: Fwd: Class instances in statics not supported in 0.8?

On Wed, Oct 8, 2008 at 10:53 AM, thron7 <thron7 <at> users.sourceforge.net> wrote:
> Gaetan de Menten wrote:
>> On Wed, Oct 8, 2008 at 9:21 AM, thron7 <thron7 <at> users.sourceforge.net> wrote:

>>> this is just a quick reply to confirm that the behaviour has indeed
>>> changed between 0.7 and 0.8 - and not intentionally. But there are some
>>> strange phenomena involved so we need to look into it further. If you
>>> could open a bug for it, adding your Application.js, that would be awesome.

>> Done.
>> http://bugzilla.qooxdoo.org/show_bug.cgi?id=1455

> Great. As a quick workaround, to get your code going, you could add the
> following compiler hints to your Application.js:
>
> /*
> #require(qx.locale.Manager)
> #require(qx.locale.Date)
> */
>
> This is of course awful, since you are fixing missing dependencies for
> the DateFormat class, but this is how you can treat it in your own code.
> The generator should do this correctly, but it is not so obvious how to
> achieve this.

Thanks. Works fine and this is already nicer than my own workaround:
recreating the instance everywhere/time I use the date format.

--

-- 
Gaëtan de Menten
(Continue reading)

thron7 | 8 Oct 15:04

Re: Fwd: Class instances in statics not supported in 0.8?

I have updated the bug at 
http://bugzilla.qooxdoo.org/show_bug.cgi?id=1455 , and also added an 
entry at the Anti-Pattern wiki page 
http://qooxdoo.org/documentation/0.8/antipatterns#abundandly_requiring_other_classes 
. This section talks in general about requiring classes in your code.

Essentially, you should avoid requiring other classes in your own code 
as much as possible, but we will also re-evaluate the strategy 
implemented in 0.7 to see if we want to re-establish this 
"doing-as-much-as-possible" in the current code base. Outcomes will be 
documented in the bug.

Thomas

Gaetan de Menten wrote:
> On Wed, Oct 8, 2008 at 10:53 AM, thron7 <thron7 <at> users.sourceforge.net> wrote:
>   
>> Gaetan de Menten wrote:
>>     
>>> On Wed, Oct 8, 2008 at 9:21 AM, thron7 <thron7 <at> users.sourceforge.net> wrote:
>>>       
>
>   
>>>> this is just a quick reply to confirm that the behaviour has indeed
>>>> changed between 0.7 and 0.8 - and not intentionally. But there are some
>>>> strange phenomena involved so we need to look into it further. If you
>>>> could open a bug for it, adding your Application.js, that would be awesome.
>>>>         
>
>   
(Continue reading)

Andreas Ecker | 8 Oct 15:04
Favicon

Re: Fwd: Class instances in statics not supported in 0.8?

Hi Gaetan!

> > Great. As a quick workaround, to get your code going, you could add the
> > following compiler hints to your Application.js:
> >
> > /*
> > #require(qx.locale.Manager)
> > #require(qx.locale.Date)
> > */
> >
> > This is of course awful, since you are fixing missing dependencies for
> > the DateFormat class, but this is how you can treat it in your own code.
> > The generator should do this correctly, but it is not so obvious how to
> > achieve this.
> 
> Thanks. Works fine and this is already nicer than my own workaround:
> recreating the instance everywhere/time I use the date format.

Sure, there are better solutions than to recreate the instance. ;-) The
preferred way (without adding manual #requires) would be not to
instantiate the class at load-time, but at run-time. Of course, you
could still assign it to a static variable as you did in your original
code. So, in your app's main() the following would be a working
equivalent:
this.self(arguments).ISO_8601_FORMAT = new
qx.util.format.DateFormat("yyyy-MM-dd");

It is recommended not to run code at load-time that would need to alter
the dependency of classes. To defer such actions to run-time is a
general cure. There'll be some elaborate information about this in the
(Continue reading)

Re: Fwd: Class instances in statics not supported in 0.8?

It is not Sourceforge who blocked the file but you received an  
automatic reply from the mail server of someone at Fujitsu Siemens  
that blocked the file.

On 8 Oct 2008, at 09:41, Gaetan de Menten wrote:

> On Wed, Oct 8, 2008 at 9:21 AM, thron7  
> <thron7 <at> users.sourceforge.net> wrote:
>
>> this is just a quick reply to confirm that the behaviour has indeed
>> changed between 0.7 and 0.8 - and not intentionally. But there are  
>> some
>> strange phenomena involved so we need to look into it further. If you
>> could open a bug for it, adding your Application.js, that would be  
>> awesome.
>
> Done.
> http://bugzilla.qooxdoo.org/show_bug.cgi?id=1455
>
>> BTW: Your Application.js went through with the first mail, at least  
>> for
>> me...!?
>
> Duh... Probably a problem at sourceforge then... I received the
> following message:
>
> from	Administrator <Administrator <at> do.not.reply>
> subject	[MailServer Notification]Attachment Blocking Notification
>
> ABGZE77E: Warning to Sender: An attachment to your message has been
(Continue reading)

Re: Fwd: Class instances in statics not supported in 0.8?

Hi,

Is it OK not to have parameter in your main function ?
That parameter nammed arguments look like used but not passed.

Also, I have a question (I still never used static with qooXdoo) what  
is the meaning of this.self(arguments) ?
Why passing argument ?

Hope this will help ...

On 7 Oct 2008, at 17:55, Gaetan de Menten wrote:

> Resending with testcase renamed to bypass stupid filter...
>
> ---------- Forwarded message ----------
> From: Gaetan de Menten <gdementen <at> gmail.com>
> Date: Tue, Oct 7, 2008 at 5:50 PM
> Subject: Class instances in statics not supported in 0.8?
> To: qooxdoo Development <qooxdoo-devel <at> lists.sourceforge.net>
>
>
> Are class instances in statics not supported in 0.8 anymore?
>
> qx.locale.Manager is undefined    DateFormat.js (line 47)
>   this.__locale = qx.locale.Manager.getInstance().getLocale();
>
> See attached test script (which worked fine in 0.7).
>
> PS: Since I don't know whether this is a bug or simply a pattern which
(Continue reading)

Gaetan de Menten | 8 Oct 09:47

Re: Fwd: Class instances in statics not supported in 0.8?

On Wed, Oct 8, 2008 at 9:00 AM, Jean-Baptiste BRIAUD - Novlog
<jb.briaud <at> novlog.com> wrote:

> Is it OK not to have parameter in your main function ?

Yes, this is a stripped down version of the app generated by
create-application, so I hope it's correct. Besides in JS, a function
can be called with less or more parameters than declared in the
function definition (and I hate this precise javascript "feature")
without any error.

> That parameter nammed arguments look like used but not passed.

This parameter has a special meaning in javascript. Check a JS
programming source.

> Also, I have a question (I still never used static with qooXdoo) what
> is the meaning of this.self(arguments) ?
> Why passing argument ?

This is (or at least was in 0.7) the recommended way to access class statics.

--

-- 
Gaëtan de Menten
http://openhex.org

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
(Continue reading)


Gmane