Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Design flow question ?

 
deepak adlakha
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18154
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
deepak adlakha
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18154
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18154
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic