Transient VO : Powerful J2EE Design Pattern

Posted by Vijay Mohan on Oracle Blogs See other posts from Oracle Blogs or by Vijay Mohan
Published on Tue, 01 Jun 2010 17:41:48 +0000 Indexed on 2010/06/01 18:14 UTC
Read the original article Hit count: 380

Filed under:
We had a use-case wherein, the communication has to happen between regions residing under differenet taskfows. Essentially, they had a common set of parameters to be used. Initially, we resorted to the  use of pageFlowScope variables, but they are tightly coupled with the individual task flows. So, how the communication has to happen..?

Some of the alternatives that we brainstormed into are -

1.usage of adf contextual event - This is a powerful feature indeed for such use-cases, but there is a considerable cost involved with it. So, before resorting to it, you have to make sure that you have good enough reason to use it.It actually does a server roundtrip and also the issue of an event and listening part to it is also something which requires your attention !!

2.Use a transientVO with shared data control scope - with shared data control scope, the transient VO rows would be persistent across the task flows in your application. All you have to do is to create the attributes in the transientVO(prefereably with the same names - for the ease of conversion) and create some utility methods in VOImpl for creating row, updating row and deleting a row. You also have to make sure that the vo row is initialized per http request( this you can do in a bookmark method of your index.jspx - residing in adfc-config.xml), else the ui fields binded to the transient vo attributes won't render in UI.

Hope, this helps and this should be a common use-case across apps.

© Oracle Blogs or respective owner