changing it to:
var instance = new yournamespace.YourClass.override(
{
members:
{
_getFormData: function() {
},
_getFormView: function() {
},
...
}
})();
solves the initialization after instantiation problem, but it looks ugly:)
2009/10/2 Petr Kobalíček <[email protected]>:
> Hi devs,
>
> Intro:
>
> I'm thinking quite time about one concept I'm using in Java -
> anonymous classes. For example in Java I can write:
>
> something = new Something() {
> �...@override
> void someMethod() {}
> }
>
> Of course this technique should be used to define new classes with
> only small additions, but I'm interested about using this feature in
> qooxdoo in forms. I have own form management and databinding library
> for qooxdoo (maybe I will release it some day, but currently it's very
> connected with our product) and declaring anonymous forms is very
> interesting idea. For example our form api has two parts - data part
> (you are defining your data) and UI part (you are defining structure
> of form) and there is problem. I need to create new class for every
> form with only small changes.
>
> Concept:
>
> I'm thinking about override() method that will override class members
> (I will start implementing this outside and then probably as a Mixin),
> so the class can be declared like this way:
>
> var instance = new yournamespace.YourClass().override(
> {
> members:
> {
> _getFormData: function() {
> },
>
> _getFormView: function() {
> },
>
> ...
> }
> });
>
> How this looks? I can imagine using similar technique also for table
> row/col renderers, etc. One problem is that it overrides members after
> instantiation. I'd like to hear what community thinks about all of
> this.
>
> Cheers
> - Petr
>
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel