Please enable JavaScript.
Coggle requires JavaScript to display documents.
JavaServer Faces Antipatterns and Best Practices (Giant View (no templates…
JavaServer Faces Antipatterns and Best
Practices
Giant Backing Bean
Source of problem
unecessary comments
complex view
several ajax methods
business logic
data access logic
hundreds of lines
solution
Refactor
multiple beans
Flat backing bean hiearchy
implement master bean
magic String dependencies
referencing jsf elements in java code
validaton
use passed in component
component binding
pass in widget
to calling method
interdependent backing bean
Unnecesary faces context lookup
threads
slow
Giant View
similar markup
no templates
faceletTemplates
composit
no reuse
fragment page
Bloated Component Tree
memory consumption
slow speed
large markup
rendering
rendered
not sent to browser
faster load
same component tree
same memory use
Questions
AJAX required?
large component tree
considerations
transient markup
not real components
small component tree
use different scopes
lower memory use
use <c:if>
component tree
control
sparingly though
view scope
issues
Lack of Dependency Injections
Use managaded properties
managed beans
limitations
mixing scoped beans
alternative
spring
advantages
speed
Inconsistent artifact name
implement naming conventions
Initializing backing bean
In constructor
use
postConstruct
lazy init
init before view is displayed
f:event
beforeRender
beforePhase