Title: What's the best design to provide communication between backing beans and leverage that for inter-portlet communication?

-- Web App

Lets say that we have several instances of the following components in a view:

Component A (Ca) is backed by bean A (Ba)

Component B (Cb) is backed by bean B (Bb)

Component C (Cc) is backed by bean C (Bc)

Besides that, the following relationship exists between the components (and beans indirectly):

Ca  1x N  Cb  1 x N Cc.

So, when some action (or event) is executed on an instance of Ca, I would like all instances of Bb associated with the instance of Ca that triggered the event, to have some method executed.

The execution of the method in Bb would also trigger the execution of another method in all instances of Bc associated with the instance of Bb that has just been executed.

Whats the best technique to implement that in JSF? Using faces events and listeners, or linking the backing beans in the logic and handle events in my code? How would this be configured?

-- Portlets

Now, let us assume that I want to deploy the above scenario in a portlet environment, so that:

Portlet A has Component A  

Portlet B has Component B

Portlet C has Component C.

The portal administrator may add or remove the portlets at any time and I can have several instances of each portlet, and somehow I must keep the relationship described in the previous example.

So, now I want the portlets to communicate with each other, like I wanted components and backing beans to communicate in the previous example. Since the JSR 168 doesnt provide inter-portlet communication, maybe JSF could help in providing such mechanism, through components.

Could I use in this case the same mechanism developed in the previous example, given the fact that the portlet lifecycle may be dynamic?

Best regards,

Marcio

Reply via email to