Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Returning Objects from ManagedBeans - Sequence diagrams

 
Sam Carlac
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As we all know, JSF Managed beans basically help the UI components, bind values, etc, etc.

So if we have this in our sequence diagram:

JSF <---> FacesServlet <---> ManagedBean <---> xyx

Would the ManagedBean actually "return" values (e.g "return List<Object>") to the FacesController or "bind" / "process" them.

Please clarify.
 
Eduardo Mineo
Ranch Hand
Posts: 63
Java jQuery Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sam,

I think there is no problem doing this, but I'd rather try to let it more high level in order to keep it very understandable. Since I'm waiting for results, I can't give you sure, but I haven't even included FacesServet on my Sequences. I put a direct conversation between my XHTML files and ManagedBeans and the return was mostly a message saying "Render page X".

--eduardo
 
Sam Carlac
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Eduardo. I think I've come too far to remove the FacesServlet now

I think it's a good way of showing the main MVC concepts, thus the reason I put it there.

Thanks again.
 
Tamal Guha
Greenhorn
Posts: 9
Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sam Carlac wrote:As we all know, JSF Managed beans basically help the UI components, bind values, etc, etc.

So if we have this in our sequence diagram:

JSF <---> FacesServlet <---> ManagedBean <---> xyx

Would the ManagedBean actually "return" values (e.g "return List<Object>") to the FacesController or "bind" / "process" them.

Please clarify.


Hi Sam

If your ManagedBean method signature is List<Object> methodXYZ(param) , I think in sequence diagram you should show the return object to FacesServlet.
Take an example, List<Product> findByCategory(categoryCode) -> where you are listing list of Products by category code. - here if you show ManagedBean returning a list of
Products (and so it is clear that managed bean is not returning just product names.... and hence controller can redirect to Product Detail page, when a product is selected ) - this seems good idea to me.



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic