PDA

View Full Version : reason for xtype?



brettAV
8 Oct 2012, 6:45 AM
Can anyone explain why we have xtype? I understand that it allows for lazy instantiation but why was this alias implementation chosen over just using the class name. Why do we have:
items [
{
xtype: something
}
]

..instead of...

items [
{
cls: "org.view.Something"
}
]

Why do we have namespaces if we're just going to refer to classes by their xtype/alias?

mitchellsimoens
10 Oct 2012, 5:12 AM
xtype is something that has been in Ext JS for many many years and allowed for lazy instantiation and smaller code. Today you can use xclass instead of xtype to instantiate but resolving a component via ComponentQuery uses xtypes