Vous êtes sur la page 1sur 2

UI:

=======
1) Avoid long ids for UI Components.
2) set partialSubmit=true whenver possible to avoid total page refresh.
3) Avoid mixing html tags for javascript, etc. Instead use af:resource.
4) Avoid inline usage of javascript/css as they are cached by browser. Instead k
eep them in separate files.
5) Don't generate clientComponents. If u need to access the UI Component in the
javascript then only
6) Use rendered property instead of visible property to hide UI Components condi
tionally.
7) Use click-to-edit instead of edit-all mode for tables.
(Non-editable rows rendered as output components:: client components not crea
ted for read-only rows::
validation phase is optimized to handle one row at a time:: Request and Resp
onse data is lower as editable row alone
is transferred b/w client and server).
8) Use appropriate content delivery options for af:table, tree table, af:tree)
9) Use appropriate fetchSize (set at iteratror, VO level)
10) Use appropriate lov types (af:inputListOfValues, af:inputComboboxListOfValue
s, af;selectOneChoice)
11) We can disable ADF rich client animation globally using animation-enabled=fa
lse in trinidid-config.xml
12) Avoid using cloumnStretching, frozen=true in af:table
13) Use pageTemplate, DeclarativeComponents, Taskflows, pageFragments.
14) If size of resource bundle is huge, split them.
15) Keep managed beans in lowest possible scopes. The getter/setter in the bean
should not be complex.
16) All managed beans (Except request) are serializable.
17) Remove unused bindings from the pageDefinition file.
18) In ViewObject use the Access mode as RangePaging instead of Scrollable. The
main difference is if you use scrollable it keeps all the rows fetched from the
DB in to the memory as you scroll down but in case of RangePaging it stores only
those rows in memory which we are seeing on the screen and it will avoid the he
avy uses of memory for Data.
19) Set partialSubmit="true" wherever it is possible on buttons,links,menu item
s.It will refresh only part of the page and not the whole page and increases the
performance.
20) ADF component bindings can not support the Serializable.To make them support
HA use the following code for component binding,getters and setters in pageFlow
Scope bean.
ex. Normal ADF code for binding,getters and setters will be as follows
Private RichSelectOneChoice partySelect
public void setPartySelect(RichSelectOneChoice partySelect) {
this.partySelect = partySelect;
}
public RichSelectOneChoice getPartySelect() {
return partySelect;
}
Change this to following code in your pageFlowScope bean to support HA.
import org.apache.myfaces.trinidad.util.ComponentReference;
Private ComponentReference partySelect;

public void setPartySelect(RichSelectOneChoice partySelect) {


this.partySelect =ComponentReference.newUIComponentReference(partySelect);
}
public RichSelectOneChoice getPartySelect() {
if(partySelect !=null){
return (RichSelectOneChoice)partySelect.getComponent();
}
return null;
}
The following files must be modified to make an ADF application High Available i
n clustered environment.
21)

Vous aimerez peut-être aussi