Search code examples
springjsfrichfacesspring-webflow

Design decision: spring webflow transitions vs JSF action handlers


Here in our application we are using Spring webflow 2.0.x and JSF1.2. Please clarify me when to go for webflow transitions and when to go for JSF beans.

for example in a single page we are having more than 20 controls in each page. like buttons, datatables, tabs, etc. and we are using a4j(richfaces) tags for Ajax requests. so, on each event a portion of the page would get rendered most of the times.

currently we are writing action handler part in flow xml files.. like wise it has become a huge file with aroung 300 lines of code and with more 30 transitions which re-renders fragments of the page.

is this the right way to implement or should i modularize/design into JSF components.

Please draw the clear line that 1) when to go for transitions and when to go for JSF Bean Handlers. 2) how would be the data exchange should happen between these two kind of components(beans)? can we access flow variables in JSF components?

Thanks in advance


Solution

  • While using SWF, We should not ideally call the beans directly. Also Logically you should break down your flows into multiple subflows. Spring fuse stated above is a good example. But not for absolute beginners. When I used SWF in my project I referred Spring in Practice, Spring Webflow Reference project (booking-faces - JSF (Prime Faces), SWF) and Spring Fuse.

    Transition also provides decoupling between UI and action class method. booking-faces has also demonstrated on using partial updates.