In this period very often someone ask me how to avoid usage of deprecated API findDataControl used usually in old implementation
MyApplicationModuleImpl am= (MyApplicationModuleImpl) BindingContext.getCurrent().findDataControl("MyApplicationModuleDataControl").getDataProvider();
you can use createRootApplicationModuleHandle as follow (official suggestion)
ApplicationModuleHandle handle =
Configuration.createRootApplicationModuleHandle("mypkg.AppModule", "AppModuleShared");
ApplicationModule sharedAM = handle.useApplicationModule();
...
Configuration.releaseRootApplicationModuleHandle(handle, false);The preferred way to have a business component access is for me the pageDefUsage. Migrating an old application you can have many occurrency of findDataControl to substitute.
I avoid the usage of createRootApplciationModule method because in my experience at runtime in seams to be slow.
No comments:
Post a Comment