Apologies if this has come up before. I'm fairly new to ST, but I feel I'm beginning to get it. The concept of configurations that automatically generate getters and setters (plus the apply and update functions) is useful and important.

That's why I'm a bit surprised that the following doesn't work:

Ext.define('MyApp.MyClass', {
config: {
foo: null,
bar: null
}
});
Ext.create('MyApp.MyClass', { foo: 'a', bar: 'b' });

I would expect the object to be initialized with those values for 'foo' and 'bar'. Following the code, I see that it just calls the 'new' operator, passing the appropriate number of arguments.

My guess is that config isn't handled because you can't be sure it's a config - it's just a single argument that happens to be an object. If that's the case, maybe passing a single argument that happens to be an object with only a single property of 'config' could trigger it.

As it is, I end up writing trivial constructors like this:

constructor: function(foo, bar) {
this.setFoo(foo);
this.setBar(bar);
}

Is there something I'm missing?