Note: Starting in JDeveloper 10g, users who work with the design time tools in JDeveloper will by default obtain the optimization described in this topic.
Use this topic if you develop applications outside of JDeveloper using the provided APIs for ADF Business Components and do not create view object metadata (XML files).
You can optimize startup time for a Business Components client
application and the remotely deployed Business Components by specifying
the list of view object attributes that your client uses. If you create
a project without the metadata, by coding to the API, you will want to
add fetchAttributeProperties() to the bootstrap code of the
client forms with a list of only the attributes used by the form.
Without this method call, your client form would fetch all control hint
properties (including the attributes format and label for example) for
all the attributes of the named view objects in the application module,
in a single network roundtrip.
For example, when you do not intend to use all the attributes of the ADF
JClient form's bound view object, with the
fetchAttributeProperties() method, your JClient form fetches only
the information required to layout your forms, while ignoring the
attributes you do not require.
Note: In local mode deployment (the client and Business Components reside in the same VM), the fetching of attribute properties is not supported.
To minimize retrieving of attribute properties (outside of the JDeveloper design time):
fetchAttributeProperties() on the ApplicationModule:
The method takes as arguments a list of view object names and a list
of attribute names for each view object. The lists may include all
or some of the attributes. If your forms require all the attributes
of a view object, you may specify null as the attribute
argument. In this case, the startup time improvement may not be
significant since your form uses all the attributes of the view
object anyway.
Note: When you use the JClient Form or Panel
wizards to generate complete forms, the
fetchAttributeProperties() method is added for you.
You should call fetchAttributeProperties() in the
JClient bootstrap code, immediately after the Data Control object is
created. In the following example, the custom properties for three
attributes of the first view object and five attributes of the
second view object are downloaded.
// bootstrap application
JUMetaObjectManager.setBaseErrorHandler(new JUErrorHandlerDlg());
JUMetaObjectManager mgr = JUMetaObjectManager.getJUMom();
mgr.setJClientDefFactory(null);
BindingContext ctx = new BindingContext();
ctx.put(DataControlFactory.APP_PARAM_ENV_INFO, new JUEnvInfoProvider());
ctx.setLocaleContext(new DefLocaleContext(null));
HashMap map = new HashMap(4);
map.put(DataControlFactory.APP_PARAMS_BINDING_CONTEXT, ctx);
mgr.loadCpx("DataBindings.cpx", map);
DCDataControl app = (DCDataControl)ctx.get("model_AppModuleDataControl");
app.setClientApp(DCDataControl.JCLIENT);
app.getApplicationModule().fetchAttributeProperties(new String[]
{"VO1", "VO2"}, new String[][]
{
{"VO1Attr1", "VO1Attr2", "VO1Attr3"},
{"VO2Attr1", "VO2Attr2", "VO2Attr3", "VO2Attr4", "VO2Attr5"}
}, null);
...
fetchAttributeProperties() will prevent property
methods such as getFormat() or getLabel() from
being called on the Business Components attribute definition whenever the
form is created.
Copyright © 1997, 2004, Oracle. All rights reserved.