aspose file tools*
The moose likes JSF and the fly likes View Helper Pattern and JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "View Helper Pattern and JSF" Watch "View Helper Pattern and JSF" New topic
Author

View Helper Pattern and JSF

Adolfo Eloy
Ranch Hand

Joined: Mar 21, 2009
Posts: 146

Hi.

I'm wondering about how View Helper pattern could be expressed with JSF.
Are Managed Beans and JSF tags the implementation strategies for View Helper using JSF applications?

My question is here because I've seen some apps where developers creates an additional class with all the components from a view mapped inside it either by String, Integer, Double or Date types either binding with UI components.
To me it seems like a form class from Struts, so I don't think it's the best way to model a JSF application and in some places this kind of class have been called View Helper.

Could someone give me some help to get those things clarified?

Thanks.



Adolfo Eloy
Software Developer
OCPJP 6
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16054
    
  21

I've seen far too many Views that were full of bindings and other stuff. I think it's because while JSF was being developed that was originally about the only way to do it, and the examples outlived their usefulness. The Internet is, alas, very good at that. I rarely use bindings. The whole point of JSF is to provide a simple interface to POJOs, but some people can't seem to tolerate simple. Well, I've been accused of that myself, buy when it comes to GUIs, I'd rather not go overboard.

In short, the ultimate "Helper" for JSF Views is JSF itself. All else is just icing.


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

Joined: Mar 21, 2009
Posts: 146

Tim Holloway wrote:I've seen far too many Views that were full of bindings and other stuff. I think it's because while JSF was being developed that was originally about the only way to do it, and the examples outlived their usefulness. The Internet is, alas, very good at that. I rarely use bindings. The whole point of JSF is to provide a simple interface to POJOs, but some people can't seem to tolerate simple. Well, I've been accused of that myself, buy when it comes to GUIs, I'd rather not go overboard.

In short, the ultimate "Helper" for JSF Views is JSF itself. All else is just icing.


Tim,

do you think that people are using JSF like the way I said before because most of them are used with action based frameworks like Struts that have the ActionForm interface? Because a class to have only the components of the view seems to be an ActionForm...
What do you think about it?

Thanks in advance.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16054
    
  21

Adolfo Eloy wrote:
Tim Holloway wrote:I've seen far too many Views that were full of bindings and other stuff. I think it's because while JSF was being developed that was originally about the only way to do it, and the examples outlived their usefulness. The Internet is, alas, very good at that. I rarely use bindings. The whole point of JSF is to provide a simple interface to POJOs, but some people can't seem to tolerate simple. Well, I've been accused of that myself, buy when it comes to GUIs, I'd rather not go overboard.

In short, the ultimate "Helper" for JSF Views is JSF itself. All else is just icing.


Tim,

do you think that people are using JSF like the way I said before because most of them are used with action based frameworks like Struts that have the ActionForm interface? Because a class to have only the components of the view seems to be an ActionForm...
What do you think about it?

Thanks in advance.


I think that it's a mixture of "cleverness" and ignorance. As I've said, there's some old, stale docs out there that do things the hard way. But I've also seen where people tried to make a brain-dead coded-by-monkeys framework out of JSF as well. A third possibility, which I'd forgotten is that some of the vendor-supplied packages seem to go this route, apparently to make it easier for their automated frameworks to get the job done (which is just another version of the brain-dead coded-by-monkeys approach).

I'm a big fan of Alan Kay's rule: "Simple things should be Simple, and Complex things should be Possible", paired with Einstein's "Everything should be as simple as possible, but no simpler". JSF works very well in that regard. However, people seem to be uncomfortable with too much simplicity -- as was parodied in the inventions of Rube Goldeberg.

I can get carried away sometimes myself, but I prefer to do it in more obscure areas and leave the basic UI stuff to be basic.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: View Helper Pattern and JSF