| Author |
JSF: Are multiple applicationControllers a good programming technique?
|
Ryder James
Greenhorn
Joined: Jun 08, 2012
Posts: 2
|
|
Sorry if this is a newbie question, but I didn't know if using more than one applicationController is acceptable.
I have a page that handles inserting and another for editing and deleting rows. I was going to use separate controllers, but I didn't know if it was common practice to run everything through one controller or break things up into more than one.
How does everyone else approach this?
Thanks for the input.
|
 |
E Armitage
Ranch Hand
Joined: Mar 17, 2012
Posts: 220
|
|
|
Just make sure you don't repeat yourself.
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14568
|
|
Welcome to the JavaRanch, Ryder?
First of all, I need to make sure of your definitions. If by "multiple applicationControllers", you mean "backing beans", backing beans are not Controllers, they are Models. I'm pointing this out because a depressingly large number of JSF apps I've seen have backing beans whose class names end with "Controller".
Anyway, the answer to that question is that yes, a View can be creating from multiple Models (backing beans), although in order to avoid confusion I recommend some restraint in doing so.
In the literal sense, every MVC system has a master (top-level) Controller that controls all of the subsidiary controllers that bind Model components to View components (web pages, forms, UI controls, etc.). In JSF, that master Controller is the FacesServlet. And There Can Be Only One.
In actuality, you don't do much programming of Controllers in JSF, because the vast majority of the Controllers are pre-written. The master controller is (as I said) the FacesServlet. The component Controllers are part and parcel of the various JSF tag implementations.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
 |
|
|
subject: JSF: Are multiple applicationControllers a good programming technique?
|
|
|