Meaningless Drivel is fun!
The moose likes JSF and the fly likes design question in JSF framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "design question in JSF framework" Watch "design question in JSF framework" New topic

design question in JSF framework

A. Dusi
Ranch Hand

Joined: Sep 27, 2004
Posts: 114
I have a page that displays a table with dynamic number of columns. I am using Tomahawk's datatable for this. I bound the table to a backing bean property so I can capture the rows and do some validations across columns for each row. The validation also involves some business logic. Is it okay to have some business logic in a backing bean? I had no other option since the datatable and the rows can be captured only there. For example, I have to check if each row is a valid combination or not.
I would like to get experts' advice on the general design issues and guidelines while using JSF framework.
Also I am interested to know if the 'Complete Reference' book covers topics like these.

Thanks in advance.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

If the data is captured in the backing bean, I see no reason you can't pass that information to some business classes. With that being said, I don't think having a minimal amount of business logic, so long as it pertains to building the view correctly, in the backing bean is a problem. It helps though to think of the backing bean as the controller in the MVC pattern. So it should more or less direct traffic and hand off business logic to helper classes when possible. My opinion anyway.

GenRocket - Experts at Building Test Data
I agree. Here's the link:
subject: design question in JSF framework
jQuery in Action, 3rd edition