I'm trying to split an enterprise app package i came up with the below approach. I have few queries i need to clarify before jumping in to code splitting operation. I'm using MVVM pattern will there be any maintenance or complexity issues occur when splitting a packages.
1) Loading a component package on demand is necessary or over engineered ?
2) How the App controller and view controllers will behave when loaded dynamically?
3) Is it safe to create a class based on below approach ?
4) Package Splitting is only for loading a view alone or can be used for loading even a package?
Code:
/*** Extends from Ext File field
*/
Ext.define('Myapp.ios.FileField', {
extend: 'Ext.field.File'
});
/**
* Custom Class for tablet case
*/
Ext.define('Myapp.android.FileField', {
extend: 'Ext.Container',
config:{
label:'',
height:50
}
});
/**
* A Wrapper class
*
*/
Ext.define('Myapp.FileField', {
xtype:'customfile',
constructor: function (args) {
if (Ext.platformTags.ios)
return Ext.create('Myapp.ios.FileField', args);
else
return Ext.create('Myapp.android.FileField', args);
}
});
var fileField = Ext.create({
xtype:'customfile',
label:'Browse File'
bind:{
value:'{vm.file}'
}
});