aspose file tools*
The moose likes JSF and the fly likes Design flow question ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Design flow question ?" Watch "Design flow question ?" New topic
Author

Design flow question ?

deepak adlakha
Ranch Hand

Joined: Jul 27, 2001
Posts: 325
Hi,

I am new to JSF's. So it may be very basic question, but i need to confirm that its correct.

for my application i am thinking following flow :-

JSF - > Managed Bean - > Controller -> Facade - > Business Delegate/Manager classes.

Is anyone see any issues with this flow ?

This will be very high level flow.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16142
    
  21

Yes. First of all, that's not "flow", it's architecture. Secondly, it's more like this:

View -> JSF (Controller) - > Managed Bean(s) (Model) - > Business Delegate/Manager -> Persistence Layer, etc.

JSF is a fairly faithful representation of the MVC achitecture.

In many cases, my Managed Beans are fa├žades or decorators for some other types of support beans (often Object Model beans), so the Model layer may have levels within it.


Customer surveys are for companies who didn't pay proper attention to begin with.
deepak adlakha
Ranch Hand

Joined: Jul 27, 2001
Posts: 325
Thanks Tim for the reply.

View -> JSF (Controller) - > Managed Bean(s) (Model) - > Business Delegate/Manager -> Persistence Layer, etc.

My only concern here is Managed bean directly calling the Business Delegate/Manager. If in future we need to change business delegate then that will impact the presentation Tier also isn't ? and will it not be tight coupling then.

Sorry i am new JSF, so may be I need go back and read more...but this is just my first thought on looking at above architecture.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16142
    
  21

Your Mileage May Vary. If so, adjust as needed. In my case, the app usually exists to "do business", so the business layer is actually one of the items less likely to change. The UI, on the other hand, is subject to adjustments based on feedback. The Backing Model normally mitigates the changes to keep the business layer independent of UI changes.

A lot of it depends on how you define your terms, though.
Davie Lin
Ranch Hand

Joined: Aug 05, 2007
Posts: 294
Hi, I am also new to JSF, my background was in Struts 1 & 2, need to learn JSF because of my new job that company currently use JSF frame work.

My question is, what's a JSF Controller if the managed bean is the Model layer? Can you give me some examples of what a JSF controller class should look like. Pesudo code would be just great
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16142
    
  21

The primary JSF controller is the FacesServlet. The secondary controllers are the display element tags. Technically, things like the validators and converters are part of the controller infrastructure as well.

Unlike desktop GUIs, you usually don't code much controller logic in JSF. The most noteworthy exception is if you code listeners. Which a lot of people do to excess. But that's another story, and I think it comes in part from the fact that obsolete documentation often lingers on the Internet to the detriment of more modern information.
 
jQuery in Action, 2nd edition
 
subject: Design flow question ?